I have tried switching which directive the injector uses with no look:
I have tried the following:
- angular.injector(['ng']).get('$rootScope')
- angular.injector(['ng', 'myApp']).get('$rootScope')
- angular.injector(['myApp', 'ng']).get('$rootScope')
The above do nothing when the event is fired.
This:
- angular.injector(['myApp']).get('$rootScope')
throws an error:
Error: Unknown provider: $routeProvider from myApp | Cause: undefinedMy Controller looks like the following:
LoadingModalCtrl = ($scope, $rootScope) ->
$scope.$on('onOpenLoadingModal', (e, data) ->
log "onOpenLoadingModal"
)
$scope.$on('onCloseLoadingModal', (e, data) ->
log "onCloseLoadingModal"
)
Any ideas if this is the correct way to implement this feature or am I barking up the wrong tree?
James