user2783193
user2783193

Reputation: 1012

accessing to config property of my custom service

I'm trying to access to my custom service into its config property to inject http interceptor like

angular
        .module("common.services")        
        .factory("redirectService",
                ["$resource", "$q", "$location", 
                 redirectService]),
        .config(function ($httpProvider) {
             $httpProvider.interceptors.push('redirectService');
        });
 function redirectService($resource, $q, $location){
   ...
 }

but obviously this is not correct cause I'm getting firebug console error

SyntaxError: expected expression, got '.' .config(function ($httpProvider) {

Upvotes: 0

Views: 43

Answers (1)

Ebin Manuval
Ebin Manuval

Reputation: 1255

remove last , from

.factory("redirectService",
   ["$resource", "$q", "$location", 
   redirectService]),

Upvotes: 3

Related Questions