the first time an element is clicked on a child array that is null, I get this error Msgstr "Unable to read the push null property" But the element is pressed, and the second time I do everything well. It is added to the array.
this.group.departmentsList.push({
name: group.newCategoryName,
sortOrder: group.departmentsList.length,
type: "category"
});
Groupcontains data, and departmentList is a child array, which is declared as follows:
$scope.parentDepartment = [
{
departmentsList: [{}]
}
];
source
share