I am experimenting with AngularJS for the first time. I am repeating a template based on JSON data, which is a sample:
$scope.users = [ {name: 'first user', status: {name: 'employee'}}, {name: 'second user', status: {name: 'freelancer'}}, {name: 'third user', status: {name: 'employee'}}, ];
This works great:
<p ng-repeat="user in users">{{user.name}}</p>
Now I want to pre-filter the displayed users. It works well:
<p ng-repeat="user in users | filter:{status: 'employee'}">{{user.name}}</p>
But when I want to filter based on JSON data inside a nested object ( status.name instead of status ), it no longer works!
<p ng-repeat="user in users | filter:{status.name: 'employee'}">{{user.name}}</p>
I am using AngularJS 1.2.18. If I use an older version like AngularJS 1.2.0-rc.3, it works again.
I can not find any information in the documentation about this behavior. Is there a new syntax or function is no longer implemented?
source share