筛选器对象不起作用angularjs
我正在使用Restangularjs,我想过滤我的数据,但它不起作用。我想那是因为我找回了东西。我该怎么办筛选器对象不起作用angularjs,angularjs,api,restangular,Angularjs,Api,Restangular,我正在使用Restangularjs,我想过滤我的数据,但它不起作用。我想那是因为我找回了东西。我该怎么办 app.controller('InventoryListCtrl', function($scope, Inventory, User, Tags, Restangular, inventoryItems) { $scope.inventories = inventoryItems; $scope.tags = new Tags().query().$o
app.controller('InventoryListCtrl', function($scope, Inventory, User, Tags, Restangular, inventoryItems) {
$scope.inventories = inventoryItems;
$scope.tags = new Tags().query().$object;
$scope.users = new User().query().$object;
});
我的配置状态
app.config(function config( $stateProvider, $urlRouterProvider) {
$stateProvider.state('inventory',{
url:'/inventory',
views: {
"main": {
controller: 'InventoryCtrl',
templateUrl: 'inventory/main.tpl.html'
}
},
data:{ pageTitle: 'Inventory' }
}
).state('inventory.listview',{
url:'/listview',
views: {
"listview": {
controller: 'InventoryListCtrl',
templateUrl: 'inventory/inventory.listview.tpl.html'
}
},
data:{ pageTitle: 'Listview' },
resolve: {
inventoryItems: function(Inventory){
return new Inventory().query();
}
}
});
});
我不能过滤我的数据
<select ng-model="inventory.model" ng-options="inventory.model for inventory in inventories">
<option value="">Model</option>
</select>
<tr ng-repeat="inventory in inventories | filter: search filter| inventory.model">
模型
如果要运行两个过滤器,必须将两个过滤器都通过管道:
<tr ng-repeat="inventory in inventories | filter: search | filter: inventory.model">