How can I inject http client
into HTTP Interceptor
? Whenever I do it, it throws: Uncaught Error: Provider parse errors:
Cannot instantiate cyclic dependency! InjectionToken_HTTP_INTERCEPTORS ("[ERROR ->]"): in NgModule AppModule in ./AppModule@-1:-1
My interceptor
looks like:
@Injectable()
export class CustomHttpInterceptor implements HttpInterceptor {
constructor(private ehs: ErrorHandlerService,
private localStorageService: LocalStorageService,
private router: Router,
private http: HttpClient
){}