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.

Комментарии • 15

  • @tanjimashraf803
    @tanjimashraf803 4 месяца назад

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

  • @Gabkets
    @Gabkets Год назад

    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.

  • @dr.faithadhiambo254
    @dr.faithadhiambo254 3 месяца назад

    Thanks for this amazing tutorial

  • @nerdiloo9863
    @nerdiloo9863 4 года назад

    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.

  • @arjunvijayvargiya4192
    @arjunvijayvargiya4192 Год назад

    Great tutorial quick to learn the new concept

  • @danielhalmstrand2123
    @danielhalmstrand2123 4 года назад

    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?

  • @lewispil3529
    @lewispil3529 Год назад

    great video

  • @SohrabRouzbeh
    @SohrabRouzbeh 2 года назад

    great video mate! how can i append multiple params?

  • @raulalvarado7025
    @raulalvarado7025 2 года назад

    Great video!!

  • @alfredonuada
    @alfredonuada 2 года назад

    Great video man

  • @ferlezcano
    @ferlezcano 2 года назад

    Great video! 👌🏼

  • @ghury1
    @ghury1 2 года назад

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

  • @sofiam6108
    @sofiam6108 Год назад

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

  • @greekplayback
    @greekplayback 4 года назад

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

    • @suki5593
      @suki5593 4 года назад +1

      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.