As @Maxim Shoustin suggested , the best way to achieve what you want is to use a custom filter.
But there are other ways: one of them is to use the ng-if directive on the same element if you put the ng-repeat directive (also here the plunker ):
<ul> <li ng-repeat="player in players" ng-if="player.name_key!='FirstPerson'"></li> </ul>
This may represent a minor aesthetic disadvantage, but it has the big advantage that your filtering can be based on a rule that is not so closely related to the players array and that can easily access other data in your application.
<li ng-repeat="player in players" ng-if="app.loggedIn && player.name != user.name" ></li>
Update
As said, this is one of the solutions to this problem and may or may not satisfy your needs.
As pointed out in the comments, ng-if is a directive that actually means that it can do more things in the background than you might expect. For example, ng-if creates a new scope from it :
The volume created in ngIf is inherited from its parent area using prototype inheritance.
This usually does not affect normal behavior, but to prevent unforeseen cases, you should keep this in mind before implementation.
gion_13 Nov 05 '13 at 7:48 2013-11-05 07:48
source share