2017-01-22 136 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