由网友(碍人.)分享简介:我有一个$资源定义自定义网址为:所有的方法。 I have a $resource that defines a custom url for the :all method. angular.module('MyApp').factory('Object', ['$resource', ($resource) -...
我有一个$资源定义自定义网址为:所有的方法。
I have a $resource that defines a custom url for the :all method.
angular.module('MyApp').
factory('Object', ['$resource', ($resource) ->
$resource(
'/api/groups/:group_id/objects/:id.json',
{
id: '@id',
group_id: '@group_id'
},
all: {
method: 'GET',
url: '/api/objects/all.json'
}
)
])
在我的页面加载,请求外出/api/objects/all.json?。它正确加载,但其中的presence?是混淆了我。我没有通过任何参数,所以为什么角加?的请求?
When my page loads, the request goes out to '/api/objects/all.json?'. It's loading correctly, but the presence of the ? is confusing to me. I didn't pass it any parameters, so why does angular add the ? to the request?
我可以摆脱它不知何故?
Can I get rid of it somehow?
推荐答案
由于角v.1.2.14此问题已得到修复。更新到它,并有一个明确的网址没有不必要的问题。
Since angular v.1.2.14 this issue has been fixed. Update to it and have a clear url without unnecessary question
相关推荐
最新文章