0

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.

DaCh
  • 921
  • 1
  • 14
  • 48
  • 1
    isn't it $rootScope with capital 'S'? https://docs.angularjs.org/api/ng/service/$rootScope – Jax Sep 10 '15 at 13:11
  • you kidding me. been sitting for over a hour trying to figure out whats worng. im gonna try it out. give me a sec. – DaCh Sep 10 '15 at 13:13
  • Well. this removed the error i got. but now i just got a $rootScope.broadcast is not a function error – DaCh Sep 10 '15 at 13:18
  • wait. forgot the $ infront of broadcast – DaCh Sep 10 '15 at 13:20
  • @Jax. my problem was as you said. so throw it as a answer an i will accept it – DaCh Sep 10 '15 at 13:21

1 Answers1

0

I think it is just that you misspelled $rootscope,

it should be $rootScope with capital 'S'?

It happens :-)

Jax
  • 1,839
  • 3
  • 18
  • 30