Reputation: 65238
I need to filter by multiple properties using an and
. How would I do something like this in angular:
ng-options="item.licenseName for item in licenses | filter: {centerId: selectedLocation.centerId and selectedLocation.state is not null}"></select>
notice the and selectedLocation.state is not null
at the end. How can I add functionaliy like this to angular.
Upvotes: 0
Views: 53
Reputation: 1734
The "and" is made by putting several filters or defining a custom one. (Note that in the first case, the second filter will be applied to the result of the filtering of the inputs by the first filter).
You could do this :
ng-options="item.licenseName for item in licenses | filter: {centerId: selectedLocation.centerId } | filter: {selectedLocation.state !== null}"></select>
Upvotes: 1