根据我需要过滤细节的选择,我有一个包含下拉列表,客户编号和PANno 。
customers.json:
---------------
{
"txns":[
{
"CustomerNumber":140000000034,
"PANNo":"AOOPT7897C"
},
{
"CustomerNumber":150000000027,
"PANNo":"AOOPT7897C"
}
]
}
$scope.customerSearch = function(){
$scope.searchStr = $scope.customerSearchStr;
var params = {
'key': 'CustomerNumber',
'searchStr': $scope.customerSearchStr
}
CustomerSearchService.list(params, function(response) {
$scope.customers = response.customers;
});
}
.factory('CustomerSearchService', ['$resource', function ($resource) {
return $resource('../app/data/customers.json', {}, {
'list': { method: 'GET', isArray: false}
});
}]);
是否可以在本地json文件中搜索?