Reputation: 51
I would like to handle $rootScope in provider method. I don't know how to inject it
that.app.config ['$authProvider', ($authProvider) ->
$authProvider.configure
apiUrl: '/api/v1'
handleTokenValidationResponse: (response) ->
// How to handle $rootScope here?
return response
]
Upvotes: 1
Views: 184
Reputation: 4505
In the provider function, you cannot inject any service or factory. This can only be done at the "$get" method.
this.$get = function($injector) {
return function(exception,cause){
var rScope = $injector.get('$rootScope');
rScope.$broadcast('exception',exception, cause);
}
};
Upvotes: 1