I have an array of attributes of users
$scope.userAttributes = [{
id: 112,
order: "first"
}, {
id: 232,
order: "second"
}, {
id: 353,
order: "third"
}, {
id: 485,
order: "fourth"
}];
and I want to use order attribute as a dropdown options with this code piece
<select ng-model= "users.number " class="form-control" ng-options="t.order for t in userAttributes">
<option ng-selected="{{t.id== users.number}}">{{t.order}}</option>
</select>
I also have array of users
$scope.users = [{
number: 112,
age: "eigth",
name: "alice"
}, {
number: 232,
age: "ten",
name: "jack"
}, {
number: 353,
age: "twelve",
name: "kevin"
}];
I will have a form through that I will change the order of users using a dropdown list but I want to see the order attribute to be pre-selected according to the number of users. For example, when I choose Kevin, at the dropdown list "third" should be there as selected(as if I did it with ng-selected) and when I change "third" to "first", the number of kevin should be changed as 232.