Я работаю с AngularJS приложением.
Я загружаю контроллер , используя сервис , как показано ниже.
showDialog: function (data) {
return $mdDialog.show({
controller: 'TestCtrl',
templateUrl: 'path_to_the_template/test.html',
clickOutsideToClose: true,
locals: {
data: data
}
});
}
TestCtrl.js , как показано ниже.
(function () {
'use strict';
angular.module("test").controller("TestCtrl", [
'$scope', 'myService', 'data', TestCtrl]);
function TestCtrl($scope, myService, data) {
// My controller functions goes here
}
})();
Это отлично работает в Chrome и Firefox. Но когда я тестирую свое приложение в Microsoft Edge, оно выдает ошибку ниже.
Error: [ng:areq] Argument 'TestCtrl' is not a function, got undefined
http://errors.angularjs.org/1.5.9/ng/areq?p0=TestCtrl&p1=not%20a%20function%2C%20got%20undefined
at assertArg (http://192.168.8.201:1337/vendor/angular/angular.js:1937:5)
at assertArgFn (http://192.168.8.201:1337/vendor/angular/angular.js:1947:3)
at $controller (http://192.168.8.201:1337/vendor/angular/angular.js:10495:9)
at link (http://192.168.8.201:1337/vendor/angular-material/angular-material.js:2093:13)
at linkElement (http://192.168.8.201:1337/vendor/angular-material/angular-material.js:3426:11)
at Anonymous function (http://192.168.8.201:1337/vendor/angular-material/angular-material.js:3300:17)
at processQueue (http://192.168.8.201:1337/vendor/angular/angular.js:16606:11)
at Anonymous function (http://192.168.8.201:1337/vendor/angular/angular.js:16622:27)
at Scope.prototype.$eval (http://192.168.8.201:1337/vendor/angular/angular.js:17913:9)
at Scope.prototype.$digest (http://192.168.8.201:1337/vendor/angular/angular.js:17727:15) undefined