#Angular

Поделиться
HTML-код
  • Опубликовано: 7 фев 2021
  • Dependency Injection is a huge and advanced topic in #angular and if you have been following my channel you should know pretty much everything about it. However, there is one remaining thing to cover - View Providers. I would not say it is widely used feature but it is definitely worth to figure out what gives us View Providers and when it could be useful. Please leave your feedbacks in comments and let's get started to explore further Angular DI. Enjoy!
    📣 Become a Pro in Angular Material Theming (Advanced Workshop) 📣
    bit.ly/angular-material-themi...
    ✅ Use 10%-off coupon code: RUclips_DISCOUNT (Only 2 coupons left)
    📣 Blazing fast GraphQL Backend just in 1 Day with Hasura Engine 📣
    bit.ly/complete-hasura-course
    ✅ 20%-off coupon code: HASURA-EASY-START
    ⚠️ New to Angular?
    Get the best onboarding Angular course which I used for easy start with Angular:
    bit.ly/angular-for-beginners
    ------------------ See my another videos about Angular ------------------
    ✅ Check out my video "My TOP 5 Angular Interview Questions"
    • TOP 5 Angular Intervie...
    ✅ Check out my videos about Angular Material Library:
    • Angular Material
    ✅ Check out my videos about Angular CDK:
    • Angular Material CDK
    #angulartutorial #webdevelopment #dependencyinjection
  • ХоббиХобби

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

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

    Fantastic content, keep on going producing video about reusability and angular, very greatfull for this video!

  • @MatiasAlibertti
    @MatiasAlibertti 3 года назад +3

    Amazing content. Thank you!

  • @vietanhvu2945
    @vietanhvu2945 3 года назад +3

    Amazing content, such a gem on youtube, how can I miss your channel all this time. Could you make a video about how to get better after familiar with angular basic ?

  • @pedrofernandes2005
    @pedrofernandes2005 3 года назад +4

    Very good explanation, and with examples makes it easier to understand where this could be useful. Thanks!

  • @alexeykharchenko4559
    @alexeykharchenko4559 3 года назад +3

    I can't understand the usefull case for that.
    Why we can't just simply use required service (GalleryCustomLoggerService) inside GallerySlideComponent (inject in constructor)?

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

      @DecodedFrontend can you please respond to this question if possible.

  • @tranzienttech8011
    @tranzienttech8011 3 года назад +1

    Excellent explanation,please make video on previous next value of textbox,how to maintain in angular internal storage mechanism

  • @navnathjadhav9111
    @navnathjadhav9111 3 года назад +3

    As usual superb explanation..

  • @VipinRawat_Offcial
    @VipinRawat_Offcial 3 года назад +1

    Waaaw simply amazing👌👌👌👌

  • @giorgikirvalidze394
    @giorgikirvalidze394 2 года назад +2

    skipself would do exactly same thing as view providers does right ?

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

    Amazing content!

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

    Thanks, best wishes ✨❄️🔥🙏

  • @rajwantsingh4750
    @rajwantsingh4750 3 года назад +3

    please make a video on the angular routing guards.....

    • @DecodedFrontend
      @DecodedFrontend  3 года назад +1

      Good point, thanks! There are a lot of interesting things to discuss there :)

  • @rboy879
    @rboy879 3 года назад +2

    Men soo good the explanation!!!. I basically an ng pro now :)

    • @DecodedFrontend
      @DecodedFrontend  3 года назад

      😄 great to hear that and thanks for feedback!

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

    Спасибо, наконец то смог разобраться.

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

      Отлично 👍🏻 Рад слышать, что видео оказалось не бесполезным 😊

  • @moisesleonor7730
    @moisesleonor7730 3 года назад +2

    Excellent video 🏅

  • @ihor-pidhornyi
    @ihor-pidhornyi 2 года назад

    What if we remove providers from the component where we are using gallery with gallery slides. Does "viewProviders" make providing own service optional? So what I mean, it's like es6 default argument value, if we not provide this argument, default value will be used in the function

  • @ilirbeqiri253
    @ilirbeqiri253 2 года назад +1

    Great Content! But what would happen if the slides' components are declared inside the gallery component's template. Will the service will be available also to them?

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

      Yes. viewProviders array makes services avaialble only for current component and current component children.

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

    How can you use the new service in the gallery and in the slide ?, now only is used in the slide component ?

  • @navnathjadhav9111
    @navnathjadhav9111 3 года назад +5

    In short does it means view providers is not available for projected content? They are only limited to current component or current component children?

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

    Hello Dmytro! First of all, your content is great and your explainations are very clear. However i tried to check it in Angular 15 and standalone components and it looks like the bevahior is different. Could you please check this out? Is this some kind of bug with standalone components?

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

      Hi! Much appreciate your feedback :) Could you please describe in a bit more detail what exactly is different when it comes to Standalone components? or maybe you have some reproducible examples in Stackblitz?

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

      Never mind... :) i must have missed something because now it works as expected

  • @Yumo3000
    @Yumo3000 3 года назад +2

    Pretty cool!! but what if i want to user different services instances on the app-gallery-slide component. Thanks for theses videos theyre super usefull

    • @DecodedFrontend
      @DecodedFrontend  3 года назад

      Hi! Do you mean that every app-gallery-slide has its own insurance of the service?

    • @Yumo3000
      @Yumo3000 3 года назад

      @@DecodedFrontend Yeah, I mean that every app-gallery-slide has its own instance of the logger interface.

    • @DecodedFrontend
      @DecodedFrontend  3 года назад

      @@Yumo3000 then you have to provide a service in app-gallery-slide component (in @Component annotation) instead of app-gallery component as it is now. If you do so, then angular create a separate instance of service for every slide component

    • @Yumo3000
      @Yumo3000 3 года назад

      ​@@DecodedFrontendYeah, that's fine, but I mean, how can I assign the service instance that is using the child, from parent component?

    • @DecodedFrontend
      @DecodedFrontend  3 года назад +2

      If you want to access the children’s service instance from parent Try to use: @ViewChild(GallerySlideComponent) slide: GallerySlideComponent; in parent (GalleryComponent) and then in “slide” you will have an instance of Slide Component and you can access there the service of the slide. Just don’t forget to change access modifier from “private” to “public” in a constructor of the slide component.

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

    Couldn't spot the difference it made. Can anyone help?

  • @aumpragashgnanaguru5484
    @aumpragashgnanaguru5484 3 года назад +2

    I like ur subscribe 😄

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

    So, can we conclude that if you have an ng-content in the template, you should use viewProviders ?

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

      Not always. Only if you want to hide some services from projected content.