空我遇到這個錯誤:錯誤:XXX是angularJS
ERROR : DISCIPLINE.EVENTS is NULL
它是由第二if
發言中提出。
下面的代碼:
angular.forEach($scope.form.disciplines, function(discipline) {
if (angular.isUndefined(discipline.events) || discipline.events == null){
angular.forEach(discipline.compets, function(compet) {
var key = compet.eventCode;
if (angular.isUndefined(discipline.events[key]) || discipline.events[key] == null) {
discipline.events[key] = {fhi:{presented : null, box : null, notAccepted : null, withdrawn : null, accepted : null}} }
});
}
});
感謝所有。
嘗試將其刪除angular.isUndefined(discipline.events)我認爲它來自這裏 – ThomasP1988