2017-01-22 111 views

回答

1

这将切换过滤器:

 $scope.setCatFilter = function(id){ 
      if($scope.catFilter == id) 
       $scope.catFilter = undefined; 
      else 
       $scope.catFilter = id; 
     } 

因此复位功能将

 $scope.resetCatFilter = function(){ 
      $scope.catFilter = undefined; 
     } 

<span ng-click="catFilter=undefined">reset</span> 
+0

我想用另一个元素重置点击 –

+0

@giorgichaduneli查看更新。 – talkhabi