Building Your First Angular HTTP Interceptor

preview_player
Показать описание
Angular's HTTP Interceptors are a super powerful way to level up the way you interact with APIs and backends. You can add tokens, logging, handle failures more gracefully, and so much more.

In this video we create our first HTTP Interceptor that appends a token to every API request we make.
Рекомендации по теме
Комментарии
Автор

I was struggling with interceptors, then I found this video simply just explaining what interceptor is. Thanks for such a straight forward explanation!

tanjimashraf
Автор

one week fighting with this f..in interceptors 😆😆 thank you so much! couldn´t find any documentation on how to add it as a provider correctly.

Gabkets
Автор

Interesting .. seems similar to service workers (sort of) except SWs don't talk to the UI and live 'outside' the app, whereas interceptors are on the 'inside'. Thanks for the tip, will explore.

nerdiloo
Автор

Hello Stephen and thanks for a great tutorial. I hade a question about this interceptor: could it checks for lack of pair of key-value in Params and in that case act upon it?

danielhalmstrand
Автор

Great tutorial quick to learn the new concept

arjunvijayvargiya
Автор

great video mate! how can i append multiple params?

SohrabRouzbeh
Автор

what if i have multiple services, and i want to apply interceptor only for specific api of specific service?

ghury
Автор

I get cors error when I try to get from the path. Can someone please help?

sofiam
Автор

Thanks :)
Can you please upload the code to github ?

greekplayback