【发布时间】:2016-03-18 00:36:16
【问题描述】:
所以我目前正在使用 $ngResouce。我的 api: api/Content/resource/user.post.failed 返回以下内容:
{
"user.post.failed": "Thing.."
}
app.factory('testResource', function ($resource) {
return $resource(apiurl + '/Content/resource/:resourcename', {}, {
show: { method: 'GET', isArray: false, params: {resourcename: '@resourcename'} },
update: { method: 'PUT', params: {id: '@id'} },
delete: { method: 'DELETE', params: {id: '@id'} }
})
});
这就是我在控制器中调用的内容
$scope.test = testResource.get({resourcename: 'test'});
这个问题其实很简单;我怎样才能得到'内容部分'所以测试。我现在要取回整个 JSON 部分。
所以现在的范围测试是:{"user.post.failed":"Thing.."} 我希望范围只是 Thing。
可能真的很简单,但我找不到答案。
【问题讨论】:
标签: angularjs json api rest get