Using Angular.js I created a form where a user could select a value. The selected value is then bound to a property on the controller.
Here is the corresponding code:
The problem is that the moment I leave the screen and come back the dropdown no longer has an item selected. When searching through the Angular.js documentation I found the following important note:
When leaving the screen and coming back, the data is fetched again from the server, so the selected application object is no longer pointing to the same object as the application objects in the list.
To fix this you can use the ‘track by’ option inside the binding expression: