我见过很多像我这样的问题,但答案似乎并没有解决我的问题。奇怪的是它以前工作过。此外,当我在用于对话框的控制器中放置断点时,用于传递值的变量不为空。该值已正确传递,但仍然是未知的提供程序错误
这是我的父控制器中的代码
function addFaq(category, ev){
$mdDialog.show({
controller: 'newfaqController'
, templateUrl: './app/components/faq/modals/newFaq.html'
, parent: angular.element(document.body)
, targetEvent: ev
, bindToController: true
, clickOutsideToClose: true
, locals: {
newFaqCategory: category
}
, controllerAs: vm
}).then(function(result){
if(result){
vm.allFaqs.push(result);
}
});
$scope.$watch(function () {
return $mdMedia('xs') || $mdMedia('sm');
}, function (wantsFullScreen) {
$scope.customFullscreen = (wantsFullScreen === true);
});
};
这些是我的对话控制器的第一行
angular.module('MyApp').controller('newfaqController', ['$mdDialog', 'newFaqCategory', 'apiFactory', newfaqController]);
function newfaqController($mdDialog, newFaqCategory, apiFactory) {