You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AngularJS
I have a problem updating a angular chosen select dropdown. This is my code which inits the dropdown from a json query and then sets the default to international, which works fine by setting the ng-model to 'international'.
<select style="width:200px;" chosen data-ng-change="setCountryFilter()" options="countries" ng-model="selectedCountry" ng-options="country.value as country.text for country in countries"> <option/> </select>
function initCountries() { ... $http.get(searchUrl).success(function(response) { $scope.countries = response; $scope.selectedCountry = 'international'; // set default for country dropdown }); }
But I have a link on the page and on click it should update the selected value in the chosen select dropdown by changing it's ng-model once more.
This does not work. I did several approaches with $scope.$apply() and $scope.$digest() but this was not successfully.
Any idea?
Sander Elias
unread,
Sep 7, 2015, 9:30:36 AM9/7/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AngularJS
Hi Newbie,
Can you put your issue in a plunk? That makes it a lot easier to help you. Normally you don't need to $apply at all, as long as you stay withing angular.