Pages

Thursday, December 17, 2015

[SOLVED] A Common Bug / Feature in Angular JS UI-Select

Recently I got into a bug which is related to Angular-UI-Select 

which is Ng-model is not updating while using ui-select

which is also reported at following links


http://stackoverflow.com/questions/25937098/ng-model-is-not-getting-changed-in-ui-select

http://stackoverflow.com/questions/27142553/angular-ui-select-ui-not-updating-model-on-select


the simple solution I came accross is to use $parent in ng-model stuff

so instead of using
ng-model="myModelVariable"
you should use
ng-model="$parent.myModelVariable"