我正在使用类似下面这样的angular $resource。
angular.module('app')
.factory('data', function ($resource) {
var Con = $resource('/api/data', {}, {
update : {method : 'PUT'}
});
return {
getData : function (user_id, callback) {
return Con.query({user_id : user_id}, function (data) {
cb(data); // (breakpoint) HERE data is not good
}, function (err) {
cb(err);
}).$promise;
}
};
});
当我在数据上设置断点时,这就是我得到的结果:
[
['w','e','l','c','o','m','e'],
['h','e','l','l','o']
]
然而,服务器发送:
['welcome','hello']
有人知道为什么这些字符串会被分割吗?
谢谢