javascript - Cannot read property push of null -
For the first time pushing for a child array, which is zero, I am getting this error "property Can not read the push of the tap "But the element is pushed, and for the second time I am completely cured. It is added to the array
this.group.departmentsList.push ({name: group.newCategoryName, sort order: group.partners list. Lamp, type: "category"}); The group contains the data and the department list is the original array that has been declared as:
$ scope.parentDepartment = [[List of departments : [[}]}];
Does not push well into any non-existent array? You can test clearly whether it is not empty and can be made if necessary:
this.group.departmentsList = this.group.departmentsList || []; This.group.departmentsList.push ({name: group.newCategoryName, sortOrder: group.departmentsList.length, type: "category"});
html कोडिंग कोडर्स के लिए नमूने
ReplyDeleteबॉर्डर-नीचे-शैली डबल ठोस धराशायी इनसेट html नमूना