Intercept HTTP Requests with Angular’s HttpInterceptor

Share this video with your friends

Send Tweet

Being able to intercept HTTP requests is crucial in a real world application. Whether it is for error handling and logging or for injecting authentication tokens. While in Angular version 2 it intercepting HTTP requests was totally possible, implementing it wasn't that trivial and intuitive. Starting from Angular version 4.3.1 there is a new, way more simpler approach of implementing HTTP interceptors. In this lesson we're going to explore how.

Wilgert Velinga
Wilgert Velinga
~ 6 years ago

You say in the video that you need to return the event from the .do operator. But this is not necessary. As can be seen in the plunker.