AngularJS First in array after Filter

前端 未结 3 1720
时光取名叫无心
时光取名叫无心 2021-01-07 23:34

In my controller I can call:

$scope.games[0];

To access the first item in my games array. Is there a way to do this keeping Filters in mind

3条回答
  •  清酒与你
    2021-01-08 00:06

    Are you using "ng-repeat"? If so take a look at the properties $first, $index, $middle, and $last. This will allow you to get info on the specific item from the repeat.

    For more info check here: http://docs.angularjs.org/api/ng.directive:ngRepeat

提交回复
热议问题