Angular 2 - Cannot instantiate cyclic dependency Angular 2 - Cannot instantiate cyclic dependency typescript typescript

Angular 2 - Cannot instantiate cyclic dependency


How about HTTP Interceptors... There's a blog post here.
If you Google you'll find more...Here's how you hook one into you App Moduleyou can clone the request in you interceptor and add X-CustomAuthHeader into headers etc.


Please see in your constructor where you inject dependency. You can't inject in a few Services the same dependency.Example: CustomXHRBackend => AuthService, AuthService => CustomXHRBackend