Reputation: 13367
Argh, this again. I have a list of objects:
var roles = [{
id: 1,
name: 'Administrator'
}];
I am using ng-options and I want to display the name and when selected, it should use the name, but there is a filter. I tried this:
role.name for role in (roleController.roles | filter: $select.search) track by role.id
But it is throwing an error. Does anyone know how to do this?
Upvotes: 0
Views: 323
Reputation: 34
Try this
role.id as role.name for role in (roleController.roles | filter: $select.search) track by role.id
Upvotes: 1