将阵列2d转换为对象[Angularjs]
我该怎么做才能将变量数组更改为二维对象。 我用Angularjs写作将阵列2d转换为对象[Angularjs],angularjs,arrays,object,Angularjs,Arrays,Object,我该怎么做才能将变量数组更改为二维对象。 我用Angularjs写作 [Object, Object, Object] 0:Object Amount :12 categoryID:"1" typeID:"1" typeName:"chicken" 1:Object Amount :23 categoryID:"1" typeID:"4" typeName:"Bird" 2:Object Amount :12
[Object, Object, Object]
0:Object
Amount :12
categoryID:"1"
typeID:"1"
typeName:"chicken"
1:Object
Amount :23
categoryID:"1"
typeID:"4"
typeName:"Bird"
2:Object
Amount :12
categoryID:"1"
typeID:"5"
typeName:"swan"
致:
我想用它来发送数据json_encode。
帮助我找到解决方案。我相信你的问题在这里得到了阿莱迪的回答:可能的重复我相信你的问题在这里得到了阿莱迪的回答:可能的重复
{
0:{
Amount :12
categoryID:"1"
typeID:"1"
typeName:"chicken"
}
1:{
Amount :23
categoryID:"1"
typeID:"4"
typeName:"Bird"
}
2:{
Amount :12
categoryID:"1"
typeID:"5"
typeName:"swan"
}
}