Search code examples
angularjsangularjs-rootscopeangular-broadcast

can't get rootscope working in controller


so im trying to broadcast a event from a controller to another. but i keep getting this error

my controller look like this.

angular.module('myApp',[]).
   controller('20SettingsController',
     ['$rootscope','$scope', '$http', '$modal', 
     function ( $rootscope, $scope, $http, $modalInstance) 
     {
        $rootscope.broadcast("fireEvents");
     }]);

I Am doing something worng?

as always thanks for your time.


Solution

  • I think it is just that you misspelled $rootscope,

    it should be $rootScope with capital 'S'?

    It happens :-)