0
我從控制器傳遞一些數據到模態控制器。ng:areq:解析數據Angular UI Modal
在我的控制器:
vm.timetableModal = modals.open.timetable(vm.store.formatted_working_hours || null);
vm.timetableModal.result.then(function (res) {
vm.store.formatted_working_hours = res.formatted_working_hours;
})
在模態廠:
function timetable(current_working_hours) {
return $uibModal.open({
templateUrl: 'templates/modals/timetable_modal.html',
controller: 'timeTableCtrl',
controllerAs: 'tm',
resolve: {
current_working_hours: current_working_hours
}
});
}
時current_working_hours
不爲空,將出現問題。
實際的錯誤是:
"Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?p0=fn&p1=not%20a%20function%2C%20got%20Object