Reputation: 1012
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
Reputation: 1255
remove last ,
from
.factory("redirectService",
["$resource", "$q", "$location",
redirectService]),
Upvotes: 3