Httpinterceptor and loading service is not compatible
See original GitHub issueThis repository’s issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
Feature request
Feature Request
HttpInterceptor and LoadingService should be compatible in my case, i want to register a loading service on OnRequest (httpinterceptor) and resolve the request on OnResponse (httpinterceptor) but i cant register the loading, but when i register the loading service in the component its work like a charm
`
@Injectable()
export class HttpInterceptor implements IHttpInterceptor {
constructor(private _loadingService: TdLoadingService) {}
onRequest(requestOptions) {
this._loadingService.register('customer-tree')
return requestOptions;
}
onRequestError(requestOptions) {
return requestOptions;
}
onResponse(response) {
return response;
}
onResponseError(error) {
return error;
}
}`
What is the expected behavior?
we should can register the loading service in the httpinterceptor method
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
HttpInterceptor is not working in lazy module - Stack Overflow
I have created the the HttpInterceptor which works fine for the App module however it is not being called for featured modules which...
Read more >That's why your Angular Interceptor may NOT WORK! [5 ...
The first two modules are NOT lazy-loaded and register interceptors. ... registered HttpInterceptors - Error handling will not work!
Read more >Angular: When HttpInterceptor doesn't work with lazy loaded ...
Abou Kone dives into a specific case when using an app wide HttpInterceptor does not work with lazy loaded features.
Read more >Class Magento\Framework\App\Http\Interceptor does not exist
An interceptor may also be missing if its parent class' constructor fails for some reason. An example of this is when you override...
Read more >HttpInterceptor - Angular
The next interceptor in the chain, or the backend if no interceptors remain in the chain. Returns. Observable<HttpEvent<any>> : An observable of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@marcoleon94 I have done something similar, if this might help…
Hi, I’ve tried to replicate almost the same behavior of this issue, I have a custom interceptor that implements the IHttpInterceptor class and it works propely on its own, but when i want to add an Authentication service on the interceptor, I get an error. My question is, am I doing something wrong when trying to add the authorization service on the interceptor, or is it a bug? I’ve checked that angular 5 had a similar issue but it was solved on version 5.2.3 wich im runinng at the moment.
I’m attaching the code example:
and the injection on my app
for which i get the next error
I’m also adding the reference from someone’s question related to what i’m trying to do https://stackoverflow.com/questions/45213352/httpinterceptor-service-httpclient-cyclic-dependency