是否有任何方法可以使用对象键动态地从对象列表中读取对象。我的复杂对象如下:
$scope.mainObject = {
name : "Some value",
desc : "Some desc",
key1: {
arrayLst: []
},
key2: {
arrayLst: []
}
}在我的方法中,key1或key2在字符串keyValue中都有键值。我如何写对象,例如:
$scope.mainObject.key1.arrayLst = data;以类似于:
$scope.mainObject.get(keyValue).arrayLst = data;发布于 2015-09-16 04:21:17
https://stackoverflow.com/questions/32599705
复制相似问题