NgDoBootstrap in Angular - Lifecycle Hook You Probably Didn't Know

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 มิ.ย. 2024
  • NgDoBootstrap is a lifecycle hook in Angular that allows you to customize the bootstrapping logic of your Angular Application. It is executed if no component is provided in the bootstrap array in the AppModule and delegates the bootstrap logic to you. In this video, we will come to this feature by investigating the source code starting from the main.ts file in Angular, diving into the source code, and seeing this lifecycle hook in action. I hope you will learn something new today! Enjoy watching :)
    💥 Angular courses made by Dmytro - bit.ly/df-courses 💥
    ✂️ Use coupon TH-cam_DISCOUNT to get a 10%-off discount ✂️
    🕒 Time Codes:
    00:00:00 - Intro;
    00:00:32 - The feature are we gonna implement?
    00:03:35 - Internals of bootstrapping process;
    00:05:39 - Bootstrapping Multiple Root Components;
    00:07:20 - Continue to investigate the Source Code;
    00:08:17 - ngDoBootstrap Hook in Action;
    00:15:22 - Outro;
    🔗 Source code on GitHub (init state on the master branch):
    github.com/DMezhenskyi/angula...
    💡 Short Frontend Snacks (Tips) every week here:
    Twitter - / decodedfrontend
    Instagram - / decodedfrontend
    LinkedIn - / dmezhenskyi
    #angular #angular14 #angularadvanced #ng
  • แนวปฏิบัติและการใช้ชีวิต

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

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

    Subscribe also to my other Social Media where I publish short Frontend Tips:
    Twitter - twitter.com/DecodedFrontend
    Instagram - instagram.com/decodedfrontend
    LinkedIn - www.linkedin.com/in/dmezhenskyi

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

      👍 🌟 💯

    • @genyklemberg
      @genyklemberg 10 หลายเดือนก่อน

      Hi Dmytro. Is it possible to create dynamic elements in component without actually creating component tag? The thing is I use component for creating different types of elements, but on this case I have extra wrapper all over the project)

  • @fernandovillanueva5135
    @fernandovillanueva5135 ปีที่แล้ว +35

    I really like this approach, I think it is important to understand why things are happening before implementing something. Excellent video!!

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

      Thanks for your valuable feedback and your thoughts, Fernando!

  • @gonzalocorchon6509
    @gonzalocorchon6509 ปีที่แล้ว +12

    I love this way of teaching this kind of stuff, because you really understand what's going on under the hood so you can remember it more easily. But most of all you have all my appreciation for explaining things that don't even appear in the official Angular documentation.

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

    No one teaching these high deeply Angular stuffs better than you. Thanks a lot!

  • @unhandledexception1948
    @unhandledexception1948 7 หลายเดือนก่อน +1

    I totally appreciate your approach to into the why instead of just handing out the solution.... so helpful, and rare that mentors spend this type of time in these videos

    • @DecodedFrontend
      @DecodedFrontend  7 หลายเดือนก่อน +1

      Thank you for this valuable feedback. I appreciate it so much!

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

    I like when you show us source code. It's pretty useful and interesting.

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

      Yeh, boy!

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

    I love this way of teaching this kind of stuff, because you really understand what's going on

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

    {{'it feel great why I see something like this content, it is not repeated and I have learn something new 👏👏👏'}}

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

    This approach is fantastic... I will not need to memorise as the steps are logical... As always, you explained it well. You are the boss of Angular in TH-cam. Advanced and interesting content for free....!!!!!

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

    This one is clearly the one that I missed. Thank you so much.

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

    I really like the approach, it tells me what I'm implementing instead of implementing it blindly 👍

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

    You post stuffs we can't find out figure out easily. Thanks a lot.
    Also i would love to see how to run 2 different angular apps in single code as you've mentioned.

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

    New approach is very good. Theres a lot of videos that explains how to bootstrap thing, but here I like approach that explains why its done this way. Its kind of deep knowledge explainded in simple way. Keep up good work.

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

    Great approach 👍
    Дякую Дмитро, бажаю успіхів і так тримати ❤️

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

    super dope - one of the best Angular channel by far. This is simply amazing and you make it look too easy lol 😇

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

    wow!!! each video is new huge lesson about development, i really appreciate your videos. about the explanation: please do it always.

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

    Awesome explanation.
    Please make a video to bootstrap the applications as separate as well.

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

    Another great video. Yeah! we want to see how to bootstrap two angular applications separately running on the same page. Thank you!

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

    Excellent work as always, I love your videos. I add a note about the last part of the video: you just provide a CSS selector as a second parameter to the bootstrap method. Thanks a lot!!!

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

    This channel is by far the best channel i have found if you want to dig deeper into angular

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

    Thanks mate! You do really good job, and in this video you described the feature that is not easy to know about from the official docs.
    And it's worth to mention, that there is another option to bootstrap any root component without creation of some anchor node. For this we can make selectors of all potential root components all the same.

  • @p.s29
    @p.s29 ปีที่แล้ว +4

    Great stuff.
    These things took me years of R&D to find.
    Keep at it. 😁

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

      You are welcome:)

    • @p.s29
      @p.s29 ปีที่แล้ว

      @@DecodedFrontend
      We created a react project at the end. 🤣
      I usually comment before watching the whole video.

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

    Excellent video, would be nice if you could create a video regarding the Routes const that we usually create to set the routes, how embedded routes are shown how using lazy loading we can establish a specific component

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

    Awesome, thanks a lot! Digging in the source code is the best approach.

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

    Didn't know this was possible. good content as usual.

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

    What an incredible content.. waiting for part 2, where you will have two or more root files completely isolated, but in the same application.. like the video there, don't be stingy

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

    This was awesome.

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

    great content as always :)

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

    Nice video Dymtro!

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

    great video! thanks

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

    Great stuff. Thank you

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

    Excellent video!

  • @hubert.t4243
    @hubert.t4243 ปีที่แล้ว

    you are awesome....thanks

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

    Thanks! It was very useful! )

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

    Best angular content! Thanks

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

    i like this type of videos

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

    Best tutor🎉

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

    wonderful video; many thanks

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

    Absolutely loved this approach

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

      Thanks for letting me know! It helps me to make content better for you 😊

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

    Thanks friend for this video !!!

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

    Wow. great video. Thank you!

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

    That’s cool 👍 Please continue.

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

    Great explanation 👌

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

    Thank you!

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

    I like this approach !!!

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

    Nice, liked this approach

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

    Thank you. I love how you break things down. 👏🏿👌🏿

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

    thanks for your videos, pls do more angular advanced videos, with explanation from source

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

    Super cool technique. Thanks!!!

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

    This is amazing 🤩, thank you so much.

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

    I really like your videos. Glad that I found you.

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

    Wow that is good to know, Thank you.

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

    you are the best, yes do the other video please!!

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

    Awesome sir again.
    I love this approach and I'd like to see more videos like this.

  • @SafetyLast-_-
    @SafetyLast-_- ปีที่แล้ว

    Great approach! Please proceed with it :)

  • @user-ir4ug1kt4e
    @user-ir4ug1kt4e ปีที่แล้ว

    Great thing. Thanks a lot for your lessons.

  • @feliperod7576
    @feliperod7576 8 หลายเดือนก่อน

    Excellent... easy... very consistent

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

    Nice video. I really appreciated this approach!

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

    Nice video and great explanation! Looking forward to seeing new videos related to this topic.

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

    Great stuff!
    You have very good skills to expressing your thoughts 👌

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

    i like this approach

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

    As always, great video. Thx Dmytro. I'm looking for the next one.

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

      Glad you like it! Thanks for the feedback 😊

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

    Good way of thinking process

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

    I like this approach, very good content, as always

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

    I like the approach you use! Great video! Thank you!

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

    you are awesome.

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

    great approch

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

    Great thing! Thanks for bringing it to us! And yep, this approach is better, it always good to know how things work under the hood.

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

    I've always liked your videos bc they're very detailed and well explained. Keep this source code first approach, it helped me a lot. Thanks!

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

    Wow, that was fantastic, thank you)))

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

      Glad you liked it! Thanks for your feedback 👍🏻

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

    Excellent explanation, i like your didatic and learn alot with your videos.

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

    This is the first time hearing of this
    Thanks a lot for your videos
    Like the new approach

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

    Шикарное видео! Формат просто отличный - спасибо тебе большое!

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

    As always very powerfull inputs, thankyou very much for all your videos are really something that I enjoy. I plan at the future to appear in angular google experts as you :)

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

    Great video. Please add more videos about forms and Internationalization

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

    Thanks!

    • @DecodedFrontend
      @DecodedFrontend  8 หลายเดือนก่อน

      Thank you so much for it ❤️🙏🏻

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

    Damn man :). You reveal really crazy staff.
    Wish I can employ some of this in the projects to come

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

    Awesome

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

    I really liked this way of explaining the concepts.Please do more videos in this way only☺️

  • @tamil_selvan-eaets
    @tamil_selvan-eaets ปีที่แล้ว

    Yes, It is a good way.

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

    Superb please share more angular advance concepts 👍❤️

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

    thanks

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

    Very informative 👍 please go ahead with your approach of investigating of code...

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

    I like your content alot thanks for your hard working

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

    💙💛 Very useful and informative vidio 💙💛

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

    Another great video thanks for sharing, yes it will be amazing if you can make a video about " bootsraping multiple app running on the same page "
    PS : i really like your teaching approach, in our job it is highly important to UNDERSAND what is happening behind the scene rather just the solution

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

    Hi, congralutions! it is very interesting and useful this way, continue with this type of video, please. could you have more video about angular material theme customization? thanks

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

    very usefull content, currently i have one app like this, with a "pro" and "basic" versions, and i'm using other strategy to do the same thing, thank you for content!

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

    We should create a page in the official docs with your videos, explaining what Angular really offers 😎.
    Regarding the approach, it encreases engagement, so yeah, bring more of it 😀

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

    Great video :) Maybe in one of the future videous you can explain something about module federation. Its quite a interesting and demanding theme

  • @86sdi
    @86sdi ปีที่แล้ว

    Yep, source code in the first place 👍

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

    great video!
    love the deep investigating!!
    have a question,
    How we can use the DoBootstrap in standalone component(without the appModule)?

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

    Thanks

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

      Wow! Thank you so much for support and your donation :) I think it is my first Super Thanks :D

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

      ​@@DecodedFrontend this idea of invistigation code i great. Can't wait for more Angular under the hood videos

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

      @@ptu15 thanks for letting me know! I will keep it in mind for sure👌🏻

  • @user-hd8dm5ur3i
    @user-hd8dm5ur3i ปีที่แล้ว

    Great Video! Is it possible to create a video about how libraries works? For example, to dive in depth how 'mat-button' change style of button or something in this way. That is for simple example. And also would be interesting something more complex - I know you have a lot of knowledge =)

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

    Дякую за відос! Ще було б дуже круто якби було круте відео про zone.js.

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

      Хм… так, це має бути цікаво) дякую за ідею👍🏻

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

      @@DecodedFrontend дякую за відгук на відгук))

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

    Thanks for the video, really appreciate your lessons. Whanted to ask a use case for this as we can do the same logic in the app.component which is root component and then decide what to load next using all angular features.

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

    I like this approach when you dig deep but also come up with some use case. The official suppose to be generic, that's why I don't see good analogies there when explaining complex topics.

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

    This video was really insightful.
    Can you please show us how can we embed two different Angular application in a single screen?
    Thanks in Advance. 😊

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

    Hi Dmytro, thanks for the explanation! I find this approach way better, but I also understand that sometimes it can be too complicated and the other one is preferred instead. We trust your judgement : )

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

      Thanks Diego! :) Yeah, that’s true, sometimes it might confuse more then help. I will be trying to keep the balance ;)

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

      @@DecodedFrontend doing a great job so far 👍

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

    Very cool approach! Thanks!
    I'm interested in case when we do not have user authorised yet. And we should show some form to fill in and go the auth server (or page like google auth) and then render the app of basic or pro version. How would you solve this? I guess a page reload will be required then?