title: Angularjs ng-repeat filtered by one property, property duplicate issue
body: <p>I want to filter my array by teams and show all players in each team, but if the name of the team is similar eg. 'team beta' and 'team beta z' duplicate problem occures.
  Player is shown in both teams...</p>
  
  <p>here is example code:
  <a href="https://jsfiddle.net/lukasz9999/qpqsuvc5/1/" rel="nofollow">https://jsfiddle.net/lukasz9999/qpqsuvc5/1/</a></p>
  
  <p>I think problem lays in filtering method</p>
  
  <pre><code>&lt;div ng-repeat="playerPerTeam in playersToFilter() | filter:filterTeams"&gt;
     &lt;b&gt;{{playerPerTeam.team}}&lt;/b&gt;
  
  &lt;li ng-repeat="player in players | filter:{team: playerPerTeam.team} | filter:searchFilter"&gt;{{player.name}}&lt;/li&gt;        
  &lt;/div&gt;
  
  
  $scope.players = [{name: 'Gene', team: 'team alpha'},
                  {name: 'George', team: 'team beta'},
                  {name: 'Steve', team: 'team gamma'},
                  {name: 'Paula', team: 'team beta'},
                  {name: 'Paula2', team: 'team beta z'},
                  {name: 'Scruath of the 5th sector', team: 'team gamma'}];
  
  
  
  var indexedTeams = [];
  
  $scope.playersToFilter = function() {
      indexedTeams = [];
      return $scope.players;
  
  }
  
  $scope.filterTeams = function(player) {
  
      var teamIsNew = indexedTeams.indexOf(player.team) == -1;
      console.log("nt "+teamIsNew)
      if (teamIsNew) {
          indexedTeams.push(player.team);
      }
      return teamIsNew;
  }
  </code></pre>
  
  <ul>
  <li>this code produces this list:</li>
  <li>team alpha
  
  <ul>
  <li>Gene</li>
  </ul></li>
  <li>team beta
  
  <ul>
  <li>George</li>
  <li>Paula</li>
  <li>Paula2</li>
  </ul></li>
  <li>team gamma
  
  <ul>
  <li>Steve</li>
  <li>Scruath of the 5th sector</li>
  </ul></li>
  <li>team beta z
  
  <ul>
  <li>Paula2</li>
  </ul></li>
  </ul>
  
  <p>name: Paula2 should be only in "team beta z" but is in "team beta" as well.</p>
  
  <p>thank you for any advices</p>