【发布时间】:2015-06-25 23:40:15
【问题描述】:
试图推入新的嵌套对象。继续在第 3 行收到cannot read property push of undefined。
为什么这不起作用?我应该换一种方式吗?
$scope.item.deliverables[0].steps[0].versions = [];
$scope.item.deliverables[0].steps[0].versions.push({assets:[{url:'aaa'}]})
$scope.item.deliverables[0].steps[0].versions.assets.push({url:'bbb'})
【问题讨论】:
-
哇!需要 NSFW 标记
-
如果您仍然遇到问题,请告诉我,以便我提供帮助
标签: javascript arrays angularjs javascript-objects