Advanced Angular Patterns - Lightweight Injection Token [2020, Angular 11]

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

ความคิดเห็น • 94

  • @DecodedFrontend
    @DecodedFrontend  4 ปีที่แล้ว +9

    💥 Learn Angular Forms in-depth and start building complex form controls with ease💥
    🔗 10% discount for the first 10 students - bit.ly/advanced-ng-forms-discounted
    💡 Short Frontend Snacks (Tips) every week here:
    Twitter - twitter.com/DecodedFrontend
    Instagram - instagram.com/decodedfrontend
    LinkedIn - www.linkedin.com/in/dmezhenskyi

    • @edbienes
      @edbienes 4 ปีที่แล้ว +2

      Great content as always! Thanks for putting this kind of tutorials.
      Can you also create a udemy course for Angular 11?

    • @DecodedFrontend
      @DecodedFrontend  4 ปีที่แล้ว +3

      @@edbienes Hi Ed! Thanks for your feedback!
      Regarding Angular course is a great suggestion, thank you :) That's something what is in my to-do list for 2021 but I have to do some market research and pick interesting topic because "Angular basics" is already very competitive and there are a lot of great courses. If you have any topic suggestion please let me know via email :)

  • @florianuhlmann1653
    @florianuhlmann1653 2 ปีที่แล้ว +9

    Haven't found anything out there that explains advanced angular topics so good.
    Just amazing, thanks

  • @adisreyaj
    @adisreyaj 4 ปีที่แล้ว +8

    Great Video. Thanks for doing videos on these advanced concepts for Angular. Keep'em coming.

    • @DecodedFrontend
      @DecodedFrontend  4 ปีที่แล้ว

      Hi, Adithya!
      Thank you very much! There will be more ;)

    • @shivanigaddagimath6105
      @shivanigaddagimath6105 3 ปีที่แล้ว

      Hi Adithya! Would you be interested in exploring job opportunities in web development? We are a web development company and looking for developers. Let me know if interested!

  • @KamelJabber1
    @KamelJabber1 3 ปีที่แล้ว +8

    You are a true Angular Hero. This was fascinating. Thank you for producing these advance enterprise angular explanations and tutorials!

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว +2

      Thank you, Kamel!🙂

    • @shivanigaddagimath6105
      @shivanigaddagimath6105 3 ปีที่แล้ว

      Hi Kamel! Would you be interested in exploring job opportunities in web development? We are a web development company and looking for developers. Let me know if interested!

  • @alaadq8130
    @alaadq8130 4 ปีที่แล้ว +6

    waiting for more cool tutorials in angular pro
    please dont stop !!

    • @DecodedFrontend
      @DecodedFrontend  4 ปีที่แล้ว +2

      I didn’t even think to stop 😄 thank you for the feedback!

    • @alaadq8130
      @alaadq8130 3 ปีที่แล้ว

      @@DecodedFrontend
      Can you make toutrials on
      Make reusable components
      And how spreate between prestinal components and smart components
      By examples
      And make them able to be used in multi projects
      I saw toutrials about using base component and extend it and use its logic to make template swapping
      And others using template outlet etc...
      I want to know how to make
      A form for example that is reusable in any project and any page
      Sorry for poor English
      ❤️

  • @giorgimerabishvili8194
    @giorgimerabishvili8194 3 ปีที่แล้ว +10

    Absolutely great channel! Waiting for more Angular stuff

  • @aswininayak5877
    @aswininayak5877 2 หลายเดือนก่อน

    Amazing. I am thinking to rewrite all my angular apps after watching this playlist 🖖🖖

  • @colemeyer1044
    @colemeyer1044 2 ปีที่แล้ว

    I thought i knew so much about angular, clearly i was wrong, your videos really made me excited to delve deeper into angular

  • @Billiam112
    @Billiam112 3 ปีที่แล้ว +8

    Recently found your channel. Great stuff for angular advanced topics. Hope to see more in the future! Thanks! :)

  • @marudhuraj6709
    @marudhuraj6709 2 ปีที่แล้ว

    I saw most of your angular videos which are very helpful to understand in advance level learning, keep rocking..

  • @anujparashar444
    @anujparashar444 2 ปีที่แล้ว

    Please keep making advance angular videos. They are soo useful! Greatful

  • @ratneshsingh6226
    @ratneshsingh6226 3 ปีที่แล้ว +3

    Awesome!!.. thanks for this great stuff... Waiting for in-depth tutorial on Router and LazyLoading....

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว

      Thanks! added to a list of topics ;)

    • @shivanigaddagimath6105
      @shivanigaddagimath6105 3 ปีที่แล้ว

      Hi Ratnesh! Would you be interested in exploring job opportunities in web development? We are a web development company and looking for developers. Let me know if interested!

  • @greg6618
    @greg6618 4 ปีที่แล้ว +1

    Looking forward watching this on weekends :)

  • @sergeyryshkevich3377
    @sergeyryshkevich3377 2 ปีที่แล้ว +1

    Brilliant explanation! Respect!

  • @rhea8133
    @rhea8133 3 ปีที่แล้ว +1

    I started learning so much because of you ! Thank you !!

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว

      Awesome! I glad to hear it and wish you success with it 😉

  • @ptu15
    @ptu15 3 ปีที่แล้ว +1

    This channel is literally brilliant!

  • @gund_ua
    @gund_ua 4 ปีที่แล้ว +5

    Very nice examples!
    I was particularly surprised when you just removed component from template and it got tree shacked, as I thought that reference in the module declarations should retain it in the bundle...

    • @DecodedFrontend
      @DecodedFrontend  4 ปีที่แล้ว +3

      Hi Alex! This is a good observation. I think we should look for the answer in Ivy and how it translate metadata. I did a quick check and it turns out that after compilation to JS the library module factory lib_shared_ui_one_module_LibSharedUiOneModule (line 8502) doesn't have any references to the components which are declared there in declarations property.. instead component factory functions has appeared in directives property when component definition happens `AppComponent.ɵcmp = ɵɵdefineComponent({ ... directives: [widget_component_WidgetComponent, widget_header_component_WidgetHeaderComponent] ... })` ... So it looks like Angular doesn't keep references to the declared modules but instead declares it individually for every component which needs some certain component 🤔Well, it is very interesting but it need some loooong debugging session & investigation :D

    • @gund_ua
      @gund_ua 4 ปีที่แล้ว

      @@DecodedFrontend Nice, this is very cool finding! I think this is the reason why they might not need NgModules in the future - after compilation components don't really need them anymore =)

    • @ihor-pidhornyi
      @ihor-pidhornyi 2 ปีที่แล้ว

      @@DecodedFrontend As far as I know, there are 2 step compilation after Angular 9. First step is going through metadata in decorators and checks what each entity needs. May be that is the moment, where directives to the components are generating and after that the second compilation part starts (if it isn't enabled partial compilation, which retains metadata and is useful for 3rd party libraries to be built in such a way), where the main view coupling is being completed.
      P.S. There are different reasons for 2 parts compilation to exist, but one important, that stays in my mind is check for the cycle dependencies during first step compilation, which isn't heavy operation and gives you response way more faster, if the compilation parts weren't separated.

  • @AmarSingh-uw1db
    @AmarSingh-uw1db 25 วันที่ผ่านมา +1

    Thanks for the knowledge ❤❤❤❤❤❤❤

  • @unnhao
    @unnhao 3 ปีที่แล้ว +1

    WOW! Nice, This channel is so great! Talk Angular deep stuff !!

  • @moisesleonor7730
    @moisesleonor7730 3 ปีที่แล้ว +2

    Great video, I hope to see videos related to testing in angular applying TDD, can be fantastic, thanks for sharing your knowledge

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว

      Good point actually! Thanks for idea :)

  • @intergral81
    @intergral81 3 ปีที่แล้ว +1

    Awesome, learning so much from you. Thank you

  • @vitaliihrechko1070
    @vitaliihrechko1070 2 ปีที่แล้ว

    Very clear explanation! Great job!

  • @jasonrooney1368
    @jasonrooney1368 2 ปีที่แล้ว

    Very helpful. However, the amount of boilerplate Angular needs to simply treeshake things shows how detrimental Angular's DI mechanisms can be.

  • @Kreator321RG
    @Kreator321RG 3 ปีที่แล้ว +1

    Thanks! It's really useful video!

  • @kumarsachin181
    @kumarsachin181 3 ปีที่แล้ว +1

    You are doing amazing work, the way you explain things are absolutely great. keep going :-)

  • @РудольфКлих
    @РудольфКлих 5 หลายเดือนก่อน

    Great video, thank you

  • @Xandrios93
    @Xandrios93 7 หลายเดือนก่อน

    Thanks for the insight

  • @rohanpanchal7742
    @rohanpanchal7742 2 ปีที่แล้ว +1

    Waiting for more stuffs.

  • @boga4791
    @boga4791 3 ปีที่แล้ว

    Omg, that was soo deep. Thank you. I saw that you have 2 more videos in design pattern list, but these are private. I wounder why, coz I thinj they must contains very interesting knowledge of angular.

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว

      Hi,
      First of all thanks for your feedback! Regarding those private videos it is a bug on TH-cam and actually all videos are public. I think it is because during uploading some of those videos failed and TH-cam kind of create a video but didn't perform clean up from database after uploading failed and they stack and marked as a private for whatever reason.. So the conclusion from it is "Always properly handle errors" :D

  • @hienhuupham
    @hienhuupham 2 ปีที่แล้ว

    Thanks a lot! Really like your content

  • @КонстантинСлавин-т6ъ
    @КонстантинСлавин-т6ъ ปีที่แล้ว

    Amazing, thanks!

  • @markwonder8168
    @markwonder8168 3 ปีที่แล้ว

    Great content! I like your way of explaining things. Keep those vids comming!

  • @aamirkhan-ql8er
    @aamirkhan-ql8er ปีที่แล้ว

    Hi Dmytro Mezhenskyi, You are the real King of Angular 😎. I learned so things from your channel.
    I have a question. Hope you will answer or make video on it. In angular.json file, we can define replacement file inside the configuration . Likewise can we define a replacement for any component or module? I have two environments dev and production. I don't want to add specific module to be the part of final build on the basis. of environment configuration. I already did some R&D but I found there is no such a way to replace component and module file inside the angular.json file. we can only replace environment configuration file. Please give some solution how to handle this situation.

  • @_cipriangg_
    @_cipriangg_ 2 ปีที่แล้ว

    Thank you!

  • @jonatabiondiJsLover
    @jonatabiondiJsLover 9 หลายเดือนก่อน

    Man you are great. How many time to reach half of your level ? :)

  • @rahultej8352
    @rahultej8352 6 หลายเดือนก่อน

    Can you please add the bridge information on how the @ContentChild is depending on DI mechanism or the provider. I am assuming it is dependent as at 06:37, you have also mentioned WidgetHeaderComponent will be used as a token value.

  • @Jose_IKJ
    @Jose_IKJ 3 ปีที่แล้ว

    Gracias chico!

  • @Aliakbaresmaeiliiii
    @Aliakbaresmaeiliiii 9 หลายเดือนก่อน

    you are awesome man Thank you for your favore

  • @rahultej8352
    @rahultej8352 6 หลายเดือนก่อน +1

    Pufffff....... mind blownnnn

  • @tharindudilshan4292
    @tharindudilshan4292 3 ปีที่แล้ว

    Thank you

  • @OlehBiblyi
    @OlehBiblyi 3 ปีที่แล้ว +1

    Really great content!

  • @ankitchoudhary3288
    @ankitchoudhary3288 3 ปีที่แล้ว +2

    Amazing stuff!
    Can anyone tell me the name of that extension from which we can see who modified the code block and when it got last modified

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว

      Hi,
      Thanks for your feedback. This extension called GitLens

    • @shivanigaddagimath6105
      @shivanigaddagimath6105 3 ปีที่แล้ว

      HI Ankit! Would you be interested in exploring job opportunities in web development? We are a web development company and looking for developers. Let me know if interested!

  • @7ob4e
    @7ob4e 3 ปีที่แล้ว +1

    Great information (thanks),
    could you please write commands how to generate libs like in this projects

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว

      Hi! Thank you for your feedback.
      The command I used is `ng g library lib-shared-ui-one` and the same for second library but different lib name.

  • @sravant
    @sravant ปีที่แล้ว

    In "new InjectionToken('widget-header')"
    can you explain what is the significance of 'widget-header' string and usages?

  • @SergioUkrAr
    @SergioUkrAr 2 ปีที่แล้ว

    Thanks, it is great, but I do't understend when I can use @Inject in my project).

  • @Jose_IKJ
    @Jose_IKJ 3 ปีที่แล้ว

    Muchas gracias! 🤩

  • @vladyslavodynets9807
    @vladyslavodynets9807 3 ปีที่แล้ว +1

    Awesome

  • @sanjaygarg3540
    @sanjaygarg3540 3 ปีที่แล้ว

    Awesome!

  • @stepandemchenko9870
    @stepandemchenko9870 4 ปีที่แล้ว +1

    Thanks a lot

  • @VladyslavTkach
    @VladyslavTkach 3 ปีที่แล้ว +1

    Thank you for video! Is there a way to create an injection token for interfaces with generic types?

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว

      Hi,
      Thank you! What do you mean exactly? Something like: InjectionToken('value');

    • @VladyslavTkach
      @VladyslavTkach 3 ปีที่แล้ว

      @@DecodedFrontend Yes. For example if you have interface List. In such cases I use abstract classes as interface.

  • @sourishdutta9600
    @sourishdutta9600 3 ปีที่แล้ว

    Hi Nice tutorial, But I have one question regarding typing intelligence, Suppose there is another method along with load and refresh (Suppose callEndPoint(){} ) inside one projection component either velocity or weather, then how I will get the type dynamically assign so that I get the typing intelligence like when we type this.widget.callEndPoint (). it will show callEndPoint (I can see you have assign type widget: Widget). How can we dynamically assign type ?? How I will achieve that ??? Thanks for your contribution

  • @beodan9219
    @beodan9219 ปีที่แล้ว

    greate

  • @mariusworchpodcast
    @mariusworchpodcast 4 ปีที่แล้ว +1

    Hey Dmytro,
    ich habe dein Dozenten Profil auf Udemy gesehen und wollte mal fragen ob wir uns zu dem Thema austauschen wollen. Wie hast du es geschafft über 7k Teilnehmer zu gewinnen und nur 21 Bewertungen zu generieren? Ich bin auch Dozent auf Udemy und finde es sehr interessant sich mit Gleichgesinnten auszutauschen.

    • @DecodedFrontend
      @DecodedFrontend  4 ปีที่แล้ว +1

      Hallo Marius,
      In Udemy gibt's ein Coupon "3 days free access" und ich habe es verwendet und innerhalb 3 Tagen habe ich 7500 neue Enrollments bekommen. Also nichts illegales ;) Auch die Sache ist die, dass die Menschen, die etwas kostenlos bekommen haben, kümmern sie sich darum nicht und lassen normalerweise keine Bewertungen :)

    • @mariusworchpodcast
      @mariusworchpodcast 4 ปีที่แล้ว

      @@DecodedFrontend Danke für die schnelle Antwort. Auf welchem Weg hast du denn den kostenlosen Code beworben, sodass so viele Teilnehmer zustande gekommen sind?

    • @DecodedFrontend
      @DecodedFrontend  4 ปีที่แล้ว +1

      Nur hier auf meinem Channel aber es stellt sich heraus, dass es viele verschiedene Coupon-Platforms gibt, die UDEMY immer zu scannen und dein Coupon automatisch auf sein Plattform hinzuzufügen.

  • @gleisonsubzeroKZ
    @gleisonsubzeroKZ 3 ปีที่แล้ว

    Hi bro, why in this case Injection Token had to be an Abstract Class instead of an Interface? since it was not necessary to have an initial implementation on abstract class.

    • @DecodedFrontend
      @DecodedFrontend  3 ปีที่แล้ว +2

      Hi Gleison,
      It is because interfaces are gone after compilation into JavaScript but we need some token which will be kind of unique identifier in DI container. That's why we use abstract class because after compilation it will be just a regular js class. Alternatively you can also use an InjectionToken.
      Here I have partly covered it: th-cam.com/video/G8zXugcYd7o/w-d-xo.html

    • @gleisonsubzeroKZ
      @gleisonsubzeroKZ 3 ปีที่แล้ว

      @@DecodedFrontend I got it, thanks for the answer, and congrats for the content.

  • @dmitriyscherbakov4978
    @dmitriyscherbakov4978 2 ปีที่แล้ว +1

    for windows (
    set NG_BUILD_MANGLE=false
    set NG_BUILD_MINIFY=false
    set NG_BUILD_BEAUTIFY=true

  • @KP-gc7fd
    @KP-gc7fd ปีที่แล้ว

    so what is the sense of injecting it in the constructor with @inject, so now you have useless header and anotherHeader properties that should be just one? which one to use?

  • @KP-gc7fd
    @KP-gc7fd ปีที่แล้ว

    what if a class already extends something? what is the pattern here?