I have something like this,
<select ng-model="person"
ng-options="person.name for person in mv.people">
Now the people array has some members that I want to hide. example:
{
name: 'john',
hide: true
}
How do I make sure these people aren't rendered as an option?
The easiest way is to use the
filterclause like this:ng-options="person.name for person in people | filter:{hide:'false'}". In the future, you can also create a custom filter for your array and apply it in theng-optionsclause. Below you have a working example.Cheers!