要将angularjs资源对象与操作方法一起使用吗
我想用angularjs资源对象对我的服务器进行搜索查询,我已经编写了这样一个资源对象 应用程序工厂('EcriDeviceListService',功能($resource){ var Url=“”; 返回$resource(Url,{id:'@id'},{update:{method:'PUT'},'search':{method:'GET',{queryText:'}) })) 有了这段代码,我想做一个这样的搜索查询 EcriDeviceListService.search({queryText:'abc'}) " 我应该如何配置我的资源对象要将angularjs资源对象与操作方法一起使用吗,angularjs,action,Angularjs,Action,我想用angularjs资源对象对我的服务器进行搜索查询,我已经编写了这样一个资源对象 应用程序工厂('EcriDeviceListService',功能($resource){ var Url=“”; 返回$resource(Url,{id:'@id'},{update:{method:'PUT'},'search':{method:'GET',{queryText:'}) })) 有了这段代码,我想做一个这样的搜索查询 EcriDeviceListService.search({queryT
谢谢。您应该像这样配置
$resource
对象:
$resource('http://localhost:60766/api/EcriDeviceLists/:id/:queryText', {
id: '@Id',
queryText: ''
}, {
update: {
method: 'PUT'
},
search: {
method: 'GET'
}
});