AngularJs Circular Dependency for Interceptor

Viewed 1387

I have the following circular dependency:

            $http
            /   \
           /     \
          /       \
         /         \
LoginManager------Interceptor
 (service)         (factory)

This Circular dependency only emerged after I added the code for Interceptor.

Interceptor will call the logout function in LoginManager in case a certain response in intercepted.

From what I see, only solution is to move interceptor code inside the LoginManager service as an anonymous factory

Is there any better way?

1 Answers
Related