4
,同时第一次推送一个元素为空数组的孩子,我得到这个错误 “无法读取属性推空” 但元素被推动,第二个当时我做的一切都fine.It被添加到阵列无法读取属性推空
this.group.departmentsList.push({
name: group.newCategoryName,
sortOrder: group.departmentsList.length,
type: "category"
});
组包含数据和departmentList是声明这样子阵列:
$scope.parentDepartment = [
{
departmentsList: [{}]
}
];
感谢@dfsq的信息 – forgottofly 2014-10-09 07:55:52
它运作良好。 – forgottofly 2014-10-09 09:14:23
我喜欢这个技术。帮了我很多。也简便易用 – Swadesh 2015-02-15 03:32:49