Angular Injection Token - When to Use It?

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024

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

  • @MonsterlessonsAcademy
    @MonsterlessonsAcademy  Месяц назад

    WATCH NEXT: Angular Unit Testing Course - All That You Need to Know About Testing - ruclips.net/video/bv9z_UfSqgM/видео.htmlsi=WVzOWtdQUZWEbqsz

  • @relliv2019
    @relliv2019 6 часов назад

    every second is valuable. thanks!

  • @wire_head10
    @wire_head10 Год назад +2

    I just came across this at work and then your video popped up. Perfect timing!

  • @yuraprotsuk
    @yuraprotsuk Год назад +5

    Thanks. Great video. I finally got the purpose of injection Tokens.

  • @AvotrainaRabemananjara
    @AvotrainaRabemananjara Год назад +6

    Cool, I like the way you explained this

  • @sivakumartadisetti3885
    @sivakumartadisetti3885 11 месяцев назад +3

    Thanks for the explanation. But what is the advantage of injecting the constant instead of just export and importing the constant into the component files? Just curious to know

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  11 месяцев назад

      We use injection token to register things in angular. you can't just use constant there.

  • @stickyamp5996
    @stickyamp5996 5 месяцев назад

    Finally i understand what is "provide"

  • @ishep123
    @ishep123 Год назад +1

    NOW i get this! thanks!

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

    Another great video! Thanks. How do Injection Tokens work with services in a stand alone environment with no NgModules?

  • @chengxiaoxia8046
    @chengxiaoxia8046 Год назад +3

    Merci!

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

    Great explanations ,, thank you

  • @knowa130
    @knowa130 Год назад +9

    I enjoy your videos but the text editor you use drives me crazy :p

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

      Sorry about that :)

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

      @@MonsterlessonsAcademy I mean I also highly appreciate your skill with that. I can see you're super proficient with this way of coding :)

    • @richarddefortune1329
      @richarddefortune1329 5 месяцев назад

      ​@@MonsterlessonsAcademy how do you replace the below code using the new injet() method?
      @Inject(SOME_TOKEN) private _service: Service

  • @MultiWarrr
    @MultiWarrr Год назад +1

    If you may make a video about ngrx entities related data normalization

  • @priyank88
    @priyank88 8 месяцев назад

    Nicely explained 😀

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

    Great explanation!

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

    Thanks!

  • @RedDeer-c4q
    @RedDeer-c4q 4 месяца назад

    i love you man

  • @ShobhitGautam-g8e
    @ShobhitGautam-g8e Год назад

    Can you explain why do we need string to be provided in InjectionToken, it is just description, in your case, you left it blank, so why we need it at all? can we use this string or it is just description

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Год назад +1

      It is just a description not a value

    • @ShobhitGautam-g8e
      @ShobhitGautam-g8e Год назад

      @@MonsterlessonsAcademy so why do we need it. And thanks for making the best video on Token i have seen, very informative

  • @MaheshKumar-bg5re
    @MaheshKumar-bg5re 10 месяцев назад

    Please make a video for ssr auth

  • @harish.d
    @harish.d 4 месяца назад

  • @slowmoshotsPZ
    @slowmoshotsPZ 10 месяцев назад

    can you please provide me the use case when to use it?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  10 месяцев назад

      It happens automatically for you every time when you register service. Injection token allow you to write custom code of using/defining services for your needs. I you don't see use cases for your project you might not have any.

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

    nice

  • @chaseliu5011
    @chaseliu5011 6 месяцев назад

    gosh Angular really trying to invent everything