Angular LifeCycle Hooks - Explained with Examples

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.พ. 2025
  • Update: Angular 16 Life Cycle Hooks: • Angular 16 Life Cycle ...
    Learn Angular LifeCycle hooks and become good angular developer. Angular hooks are really helpful in understanding how angular execute your code, components and directives.
    #angular #angularhooks #angularlifecyclehooks
    This tutorial uses helpful examples and explain you how, when and why to use each angular lifecycle hooks.
    ngOnChanges() - 1:40
    ngOnInit() - 23:00
    ngDoCheck() - 24:00
    ngAfterContentInit() - 34:20
    ngAfterContentChecked() - 37:50
    ngAfterViewInit() - 40:25
    ngAfterViewChecked() - 42:50
    ngOnDestroy() - 44:55
    ************************************************
    Udemy Course:
    Angular & Loopback: www.udemy.com/...
    ************************************************
    My Computer Setup :
    MacBook Pro : amzn.to/31CtKHw
    Monitor: amzn.to/31Jubj9
    Microphone: amzn.to/2KDZYfM
    Keyboard: amzn.to/2KCkjSA
    Mouse: amzn.to/2KXcNku
    ****************************************************
    Connect With Me:
    Twitter : / awaismirza01
    Facebook: / awaismirza01

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

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

    Here is the updated video on Angular 16 Life Cycle hooks: th-cam.com/video/Qts7H8P-FpI/w-d-xo.html
    Also subscribe my new channel.

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

    Build complete web app with javascript. Email at umairjameel321@gmail.com for $10 coupon.
    www.udemy.com/angular-loopback-build-complete-website-from-scratch/

    • @vasanthakumarkamaraj9671
      @vasanthakumarkamaraj9671 5 ปีที่แล้ว

      Good one..

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

      i guess it is quite off topic but do anyone know of a good website to stream newly released movies online?

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

    Amazing. Thank you for the grt explanation
    Janet, Singapore

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

    Thanks you very much for the great explanation. Keep up the good work.

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

    Very clearly explained!

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

    Seriously I proud of you such a great experience Vere very very nice

  • @sandippatil-zu5lg
    @sandippatil-zu5lg 2 ปีที่แล้ว

    very nice

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

    Excellent teaching hats off sir

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

    this is a must see video

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

    Clear and clean.

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

    well, Explained!!

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

    good video...clear explanation..i like the use of debugger... you got 1 new subscriber

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

    This explanation we even get in documentation.. What we need is real time example when we use it and what we should use with more details.

  • @rapidreports-daily
    @rapidreports-daily 3 ปีที่แล้ว

    It's just Wow!!

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

    very helpful content.

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

    Thank you sir

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

    Very nice and clear explanation 👍

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

    Excellent 👌

  • @deepakchauhan-jc2yy
    @deepakchauhan-jc2yy 4 ปีที่แล้ว

    Thanks great explanation

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

      you might understood that when that hook being called. But you may not know for sure when to use it in real time.. hahahah

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

    my values are not incrementing & decrementing what may be the problem. (@Input myNewNumber : number) shows an error it has to be initialized and I changed "strictPropertyInitialization": false , then error has gone but still inc, dec is not happening

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

      it is sign that you quit and go with other framework :D

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

    best video so far on lifecycle hooks only down side is that you didnt go that in debt on the last view lifecycles i dont completely get how if you have a child components in your child component class you made depend or interact with the cycles you mentioned

  • @Finn-jp6pn
    @Finn-jp6pn 4 ปีที่แล้ว

    @31:11 When you say "won't get detected any change using pass-by-reference"
    Do you mean if we have an object and we change a single property on the same object?
    Thank you for the lengthy explanation.

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

    awesome explanation

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

    13:58 Some thing from the parent component came inside the child component. It was my number 2. 🤔
    Stupid jokes aside, great video indeed. :)
    Just when it came to explaining the AfterContentChecked, it didn't become clear to me. AfterContentChecked is executed when change detection finishes for any you may have in your component. As in, This paragraph is part of my component's ng-content.

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

      Can you please tell me about ngAfterContentInit, ngAfterContentChecked,NgAfterViewInit and ngAfterViewChecked in detail? If I make change anything to my component...all thsese cycles are getting triggered but I couldn’t understand the difference. ☹

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

    we are looking for a simple explanation of lifecycle hooks not Typescript complex OOPS concepts.

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

    nice explanation

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

    thank u

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

    there is serious room for improvement on the console log messages if their purpose is to follow lifecycle hook methods being called. So, no "yaaaayyy", no "this was called after ..." (who is "this" at that point? - one of the classical JS misteries)

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

    36:42 why ngDoCheck has been called two times?

    • @Finn-jp6pn
      @Finn-jp6pn 4 ปีที่แล้ว +1

      Because ngDocheck is called each time the change detection cycle runs. ngOnChanges is only called if the reference of the @Input() bound object changes

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

    Great Great thx yar

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

    thank you !!!!

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

    I didn t quite understand how in app.component.ts and in increment/decrement methods do associate the "this.counter" value with the value of the "private number". I might be inexperienced in typescript but wasn 't supposed there to be this.number++/this.number-- instead this.counter++/this.counter-- even though everything works fine with "this.counter".

    • @sambitdas3795
      @sambitdas3795 5 ปีที่แล้ว

      java script setter and getter method is used in that case.

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

    Please give me example code bro

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

    Very Informative video, Can you also make video on Angular observable and Behavior Subject

  • @jpssasadara3624
    @jpssasadara3624 5 ปีที่แล้ว

    thanks

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

    ngaftercontentinit and ngafterViewINIt not understood yet

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

    bro.. volume is very low. putting 100% volume is not audible.

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

    thank brother supp

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

    Not convenient

  • @VikasSharma-me3xn
    @VikasSharma-me3xn 3 ปีที่แล้ว +1

    One of the worst explanation and accent is really funny..