You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then I have a button which loads some data from my api, and I'd like to update the dropdown options, based on this data. So I did something like this:
// Inside some controller method, called on button click....
myService.getData()
.then(function (data) {
$scope.examplePeople = data; // Updating the existing....
console.log($scope.examplePeople); // Check if the array has nwe items come from api
});
I expected the options to be updated, since Angular is two-way binding, instead it keeps the old options. Am I missing something, or do I need to call something explicitly to reload the dropdown options?
Many thanks, awesome work done by you!!!
The text was updated successfully, but these errors were encountered:
I managed to populate a dropdown using a predefined array of options like the sample code in oficial page, like this:
Then I have a button which loads some data from my api, and I'd like to update the dropdown options, based on this data. So I did something like this:
I expected the options to be updated, since Angular is two-way binding, instead it keeps the old options. Am I missing something, or do I need to call something explicitly to reload the dropdown options?
Many thanks, awesome work done by you!!!
The text was updated successfully, but these errors were encountered: