Angular JS链接filterFilter

时间:2016-06-13 09:56:00

标签: angularjs filter

这是我的角度代码。

 $scope.names = [
      {name: 'Tobias', gender: 'm'},
      {name: 'Jeff', gender: 'm'},
      {name: 'Lisa', gender: 'f'},
      {name: 'Diana', gender: 'f'},
      {name: 'James', gender: 'm'},
      {name: 'Brad', gender: 'm'}
    ];

    $scope.filteredNames = filterFilter($scope.names, 'a');
    $scope.filteredNamesByFemale = filterFilter($scope.names, {gender: 'f'});

我想知道如何链接两个过滤器filterFilter($scope.names, 'a')filterFilter($scope.names, {gender: 'f'})

1 个答案:

答案 0 :(得分:0)

在第二次通话中通过$scope.filteredNames而不是$scope.names