我有一個列表過濾:如何通過將其保留爲空來重置過濾器?
<input ng-model="searchFileName" />
<table>
<tr ng-repeat="file in folders | filter:searchFileName">
<td><a ng-click="openFolder(file.name)">{{ file.name }}</a></td>
</tr>
</table>
我想清楚searchFileName值當我點擊搜索結果。
這是openFolder功能:
$scope.openFolder = function(name) {
$scope.searchFileName = null;
$http.jsonp($scope.server + '?open=' + encodeURIComponent($scope.buildTreePath()) + '&callback=JSON_CALLBACK').success(function(data){
$scope.folders = data;
});
}
}
我不能空我過濾器領域,這是行不通的......我在哪裏錯了?
儘量把'$ scope.searchFileName = NULL;'成功回調內,臨近'$ scope.folders =數據;' – 2014-10-10 14:06:32