When attempting to access my custom service within its config property in order to inject an HTTP interceptor, I am encountering the following issue:
angular
.module("common.services")
.factory("redirectService",
["$resource", "$q", "$location",
redirectService]),
.config(function ($httpProvider) {
$httpProvider.interceptors.push('redirectService');
});
function redirectService($resource, $q, $location){
...
}
It is clear that this approach is incorrect as it is resulting in a SyntaxError being displayed in the firebug console:
SyntaxError: expected expression, got '.' .config(function ($httpProvider) {