目前我有这样的资源:
return $resource(usersUrl, {}, {
//The data model is loaded via a GET request to the app
query: {method: 'GET', params: {}, isArray: false},
putupdate: {method: 'PUT', params:{}}
});
现在我想放一些看起来像这样的 JSON:
{"providerid":"userpass","firstname":"t","lastname":"b","fullname":"t b","email":"emailaddress,"avatarurl":"http:/.....","passwordset":true}
无论如何,您可以看到它没有顶级名称,如果我将此信息作为参数传递给资源,则会将名称附加到 json 中,例如:
myparam:{"providerid":"userpass","firstname":"t","lastname":"b","fullname":"t b","email":"emailaddress,"avatarurl":"http:/.....","passwordset":true}
由于服务器端不喜欢它,是否有办法防止这种情况发生?
谢谢
汤姆