Angularjs can';无法使rootscope在控制器中工作
因此,我试图将一个事件从一个控制器广播到另一个控制器。 但我一直都有这个 我的控制器看起来像这样Angularjs can';无法使rootscope在控制器中工作,angularjs,angularjs-rootscope,angular-broadcast,Angularjs,Angularjs Rootscope,Angular Broadcast,因此,我试图将一个事件从一个控制器广播到另一个控制器。 但我一直都有这个 我的控制器看起来像这样 angular.module('myApp',[]). controller('20SettingsController', ['$rootscope','$scope', '$http', '$modal', function ( $rootscope, $scope, $http, $modalInstance) { $rootscope.
angular.module('myApp',[]).
controller('20SettingsController',
['$rootscope','$scope', '$http', '$modal',
function ( $rootscope, $scope, $http, $modalInstance)
{
$rootscope.broadcast("fireEvents");
}]);
我在干什么
一如既往地感谢您的时间。我想只是您拼错了$rootscope 它应该是大写字母“S”的吗
发生了:-)是不是$rootScope加上大写字母“S”?你在开玩笑吧。我坐了一个多小时想弄清楚发生了什么事。我要试试看。给我一点时间。这消除了我的错误。但是现在我得到了$rootScope.broadcast不是一个函数errorwait。忘了前面的$broadcast@Jax. 我的问题正如你所说。所以,把它作为一个答案,我会接受它