ng-change get new value and original value

With an angular {{expression}} you can add the old user or user.id value to the ng-change attribute as a literal string: <select ng-change=”updateValue(user, ‘{{user.id}}’)” ng-model=”user.id” ng-options=”user.id as user.name for user in users”> </select> On ngChange, the 1st argument to updateValue will be the new user value, the 2nd argument will be the literal that was … Read more

ng-options with simple array init

You actually had it correct in your third attempt. <select ng-model=”myselect” ng-options=”o as o for o in options”></select> See a working example here: http://plnkr.co/edit/xEERH2zDQ5mPXt9qCl6k?p=preview The trick is that AngularJS writes the keys as numbers from 0 to n anyway, and translates back when updating the model. As a result, the HTML will look incorrect but … Read more

Working with select using AngularJS’s ng-options

One thing to note is that ngModel is required for ngOptions to work… note the ng-model=”blah” which is saying “set $scope.blah to the selected value”. Try this: <select ng-model=”blah” ng-options=”item.ID as item.Title for item in items”></select> Here’s more from AngularJS’s documentation (if you haven’t seen it): for array data sources: label for value in array … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)