Restangular无法获得()我的回复

时间:2015-09-23 17:27:46

标签: json angularjs restangular

我正在尝试使用Restangular。从服务器端我收到以下回复:

[{"myModules":[{"code":"MODULE_Test","features":[],"name":"Testing"},  {"code":"MODULE_ADMIN","features":[],"name":"Portal Admin"}],"otherModules":  [{"code":"MODULE_ASSET_EFF","name":"Asset"},{"code":"MODULE_CARE_PATTERN","name":"Care Pattern"},{"code":"MODULE_NETWORK","name":"Network"},{"code":"MODULE_PERFORMANC","name":"Performance"},{"code":"MODULE_POADM","name":"Portal"}]}]

我无法在客户端获取该响应。以下是我的代码。

         Restangular.all('/rest/authorization/getData').getList()
         .then(function(user){
                var people = user;
            },function(error) {
                alert('testing');
                error.log("Error with status code", response.status);
            });

当我调试并看到里面的人物'变量 我无法看到我的json回复。我只能看到:

addRestangularMethod: bound fetchFunction()
all: bound fetchFunction()
allUrl: bound fetchFunction()
clone: bound fetchFunction()
customDELETE: bound fetchFunction()
customGET: bound fetchFunction()
customGETLIST: bound fetchFunction()
customOperation: bound fetchFunction()
customPOST: bound fetchFunction()
customPUT: bound fetchFunction()
doDELETE: bound fetchFunction()
doGET: bound fetchFunction()
doGETLIST: bound fetchFunction()
doPOST: bound fetchFunction()
doPUT: bound fetchFunction()
fromServer: true
get: bound fetchFunction()
getList: bound fetchFunction()
getRequestedUrl: bound fetchFunction()
getRestangularUrl: bound fetchFunction()
head: bound fetchFunction()
length: 0
one: bound fetchFunction()
oneUrl: bound fetchFunction()
options: bound fetchFunction()
parentResource: null
patch: bound fetchFunction()
plain: bound fetchFunction()
post: bound fetchFunction()
putElement: bound fetchFunction()
remove: bound fetchFunction()
reqParams: null
restangularCollection: true
restangularized: true
route: "/restServices/authorization/getData"
several: bound fetchFunction()
trace: bound fetchFunction()
withHttpConfig: bound fetchFunction()
__proto__: Array[0] 

虽然我能够在谷歌浏览器的网络标签中看到json响应。

0 个答案:

没有答案