When using ng-init in combination with an array there is never an init value. After trying all the possible options, i hope someone can find a fix for this problem.
The html
<select class="update-invisible" ng-model="user.level" ng-init="user.level" ng-change="updateUserlevel(user)" ng-options="userlevel.id as userlevel.label for userlevel in userlevels track by userlevel.id"></select>
Note: the ngmodel (user.level) is an integer that specifies the current userlevel, in an user information object. In this object the userlevel has to be updated in order to change the users permission.
userlevels object, to match the user.level int to a string to display front end
$scope.userlevels = [{
id: 1,
label: 'Regular user'
},{
id: 2,
label: 'Administrator'
}];
You should use
ng-initto evaluate an angular expression. The following snip sets thelevelproperty of theuserscope object to 5.