我将字符串数组从服务器发送:
Node.JS + Express.JS
app.get('/url', function (req, res) {
res.send(["item1", "item2", "item3"]);
})
但是在前端我收到的是对象数组:
Angular.JS
SomeResource.query(function (data) {
console.log(data);
});
在控制台中
0: Resource
0: "i"
1: "t"
2: "e"
3: "m"
4: "1"
$$hashKey: "008"
__proto__: Resource
1: Resource
0: "i"
1: "t"
2: "e"
3: "m"
4: "2"
$$hashKey: "009"
__proto__: Resource
2: Resource
0: "i"
1: "t"
2: "e"
3: "m"
4: "3"
$$hashKey: "00A"
__proto__: Resource
为什么会发生这种情况?我如何在前端接收相同的数组? 谢谢。