admin管理员组文章数量:1425717
I have a quick question. In angular js where (like which object) does the '@id' e from in the following piece of code from a rails app?
var User = $resource("/users/:id", {id: '@id'});
I know it sets the default id.
Thanks
I have a quick question. In angular js where (like which object) does the '@id' e from in the following piece of code from a rails app?
var User = $resource("/users/:id", {id: '@id'});
I know it sets the default id.
Thanks
Share Improve this question asked Feb 25, 2013 at 3:47 GTDevGTDev 5,51810 gold badges50 silver badges84 bronze badges1 Answer
Reset to default 7From the AngularJs documentation:
"If the parameter value is prefixed with @ then the value of that parameter is extracted from the data object (useful for non-GET operations)."
This means that when calling a non-GET operation, like POST, you can pass the id as one of the fields of the data object you include in the call.
本文标签: javascriptAngularjs ngResource 39id39Stack Overflow
版权声明:本文标题:javascript - Angularjs ngResource '@id' - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745366105a2655520.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论