Video není dostupné.
Omlouváme se.

S3E3 What's the difference between markForCheck() and detectChanges()

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • If you don't switch off NgZone the difference between markForCheck() and detectChanges() is hardly visible. markForCheck() is made for OnPush change detection strategy to let ChangeDetector know that component needs to be checked even if its inputs are the same. detectChanges() is mostly used in combination with detach(), when you want to perform local change detection checks.
    Official docs:
    angular.io/api/core/ChangeDet...
    Code: github.com/stevermeister/Angu...
    Angular Pro Screencasts Roadmap - github.com/stevermeister/Angu...
    If you have any question or suggestion please put a comment, or ping me on Twitter - / stevermeister

Komentáře • 33

  • @stevermeister
    @stevermeister  Před 2 měsíci

    Just FYI
    💥 I've decided to create a separate Angular Pro CZcams channel - www.youtube.com/@AngularPro
    see you there!

  • @emmadzahid1555
    @emmadzahid1555 Před 2 měsíci

    Best explanation ever that even many big channels could not explain!

    • @stevermeister
      @stevermeister  Před 2 měsíci

      thank you for your kind words!
      I've created a separate channel for Angular Screencast here - www.youtube.com/@AngularPro

  • @shemnech8115
    @shemnech8115 Před 3 měsíci

    This is the best of all cdr example cases in the web I have ever seen. Bravo Stepan.

    • @stevermeister
      @stevermeister  Před 3 měsíci

      just FYI, I've created a separate channel that is dedicated for Angular Pro topics - czcams.com/channels/lJMItOKKr1_B6YFrHDetKQ.html

  • @alinciocan5239
    @alinciocan5239 Před 3 lety +5

    So simple and in such a short time explained. Good job!

  • @IamBad_at_this
    @IamBad_at_this Před měsícem

    great video, best explanation. Thanks so much guru.

  • @xocomil
    @xocomil Před rokem +2

    Excellent video. Very good explanation of the difference between the two methods.

    • @stevermeister
      @stevermeister  Před rokem

      great to hear that you liked it.
      just for your information: I have created a separate channel with English-only content where plan to add new videos - www.youtube.com/@AngularPro

  • @UdayKumar-xr2me
    @UdayKumar-xr2me Před 2 lety +1

    Very clear explanation from basics.. Thanks.

  • @omardotbio
    @omardotbio Před rokem

    Well explained. The example used was clear and concise. Thank you!

  • @KamilNajax
    @KamilNajax Před 2 měsíci

    awesome video!

  • @btx47
    @btx47 Před rokem

    Really great example!

  • @Wielorybkek
    @Wielorybkek Před rokem

    awesome explanation!

  • @RajansYoutubeChannel
    @RajansYoutubeChannel Před 3 lety +1

    This is amazing, thanks

  • @user-hs9uf8fg5k
    @user-hs9uf8fg5k Před 3 lety +1

    спасибо, за исходники в частности

  • @unnhao
    @unnhao Před 2 lety

    This video is very useful !!

  • @abhijeetdey
    @abhijeetdey Před 2 lety

    Thank you so much!

  • @RaviSharma91
    @RaviSharma91 Před 3 lety

    thank you for this.

  • @bamossza
    @bamossza Před 3 lety

    Thanks so much.

  • @Wisdomseeker_
    @Wisdomseeker_ Před 3 lety

    good explanation

  • @javascript_developer
    @javascript_developer Před 2 lety

    good one

  • @ankush3707
    @ankush3707 Před 3 lety

    what a video nice

  • @davidontiveros2895
    @davidontiveros2895 Před 2 lety

    Good video Stepan. Concise. Quick question. Have you had issues unit testing components that use markForCheck ?

  • @plee821
    @plee821 Před 2 lety

    One thing I don't seem to find an answer for. Does the whole component tree run CD when using the Default ChangeDetectionStrategy? So for instance, if it is set to Default, and Cmp7 a template binding changes, does CD run for the whole tree (every single component in the app)?

    • @stevermeister
      @stevermeister  Před 2 lety

      yes, you are right, it will run CD for all the components.
      you can play with code yourself.

  • @swaminathbera6407
    @swaminathbera6407 Před 3 lety

    It's good, but can't understand...
    can you make beginner videos too like on : what is ngZone, changeDetection,etc

    • @stevermeister
      @stevermeister  Před 3 lety

      I think there are a lot of beginner videos on the internet. I recommend you this course - codecraft.tv/courses/angular/quickstart/overview/
      I decided to focus more on Pro topics that is not covered enough, IMHO

    • @stevermeister
      @stevermeister  Před 3 lety

      Also if you just starting with Angular and need to now first steps here is another video - czcams.com/video/5juzxptjRhA/video.html

    • @stevermeister
      @stevermeister  Před 3 lety

      @Watanabe Yasuke that's partially covered in the video description, right? or you would like to see more examples?

  • @fatihersoy7559
    @fatihersoy7559 Před 3 lety

    It would be great if you can create this also as stackblitz project.

    • @stevermeister
      @stevermeister  Před 3 lety +1

      I think you can use this feature - developer.stackblitz.com/docs/platform/importing-projects/
      I keep it in GitHub to make it possible to update from time to time.