如何在AngularJS $ http.get响应中保留重复的键值?

时间:2016-08-03 05:10:26

标签: angularjs json

当我使用$ http.get获取带有重复键的JSON文件时,响应只有重复键的最后一个键值对。

JSON - data.json:

{
    "hello": [{"cell" : "1"}],
    "hello": [{"cell" : "2"}]
}

拨打$ http.get:

$http.get("data.json").success(
         function(response) {
             console.log(response);
         }
);

但响应只包含

{"hello": [{"cell" : "2"}]}

是否可以使用相同的键获取具有多个键值对的json对象?感谢。

0 个答案:

没有答案