Building Your First Angular HTTP Interceptor
HTML-код
- Опубликовано: 8 окт 2024
- 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!
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.
Thanks for this amazing tutorial
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.
Great tutorial quick to learn the new concept
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?
great video
great video mate! how can i append multiple params?
Great video!!
Great video man
Great video! 👌🏼
what if i have multiple services, and i want to apply interceptor only for specific api of specific service?
I get cors error when I try to get from the path. Can someone please help?
Thanks :)
Can you please upload the code to github ?
It's simple, you can recreate it. Just use ng new myNewApp to create a new app and then create the interceptor following this video.