Struggling to properly filter out records in an ng-repeat
and facing some challenges. Check out my issue on this Plunker link.
This is the code snippet I'm working with:
$scope.userRoles = [
{ name: 'first user', role: { name: 'Agent' } },
{ name: 'second user', role: { name: 'Admin' } },
{ name: 'third user', role: { name: 'Super Admin' }
}];
<li ng-repeat="userRole in userRoles | filter:{role.name:'!Agent'}">
{{userRole.name}}
</li>
Expecting to see "Admin" and "Super Admin" in the resulting list, however, encountering an elusive exception that's proving hard to resolve. Working with Angular version 1.4.3. The documentation suggests this is the correct way to apply negation in filtering.