Video není dostupné.
Omlouváme se.
S3E3 What's the difference between markForCheck() and detectChanges()
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
Just FYI
💥 I've decided to create a separate Angular Pro CZcams channel - www.youtube.com/@AngularPro
see you there!
Best explanation ever that even many big channels could not explain!
thank you for your kind words!
I've created a separate channel for Angular Screencast here - www.youtube.com/@AngularPro
This is the best of all cdr example cases in the web I have ever seen. Bravo Stepan.
just FYI, I've created a separate channel that is dedicated for Angular Pro topics - czcams.com/channels/lJMItOKKr1_B6YFrHDetKQ.html
So simple and in such a short time explained. Good job!
great video, best explanation. Thanks so much guru.
Excellent video. Very good explanation of the difference between the two methods.
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
Very clear explanation from basics.. Thanks.
Well explained. The example used was clear and concise. Thank you!
awesome video!
Really great example!
awesome explanation!
This is amazing, thanks
спасибо, за исходники в частности
This video is very useful !!
Thank you so much!
thank you for this.
Thanks so much.
good explanation
good one
what a video nice
Good video Stepan. Concise. Quick question. Have you had issues unit testing components that use markForCheck ?
thank you, David. what sort of issues?
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)?
yes, you are right, it will run CD for all the components.
you can play with code yourself.
It's good, but can't understand...
can you make beginner videos too like on : what is ngZone, changeDetection,etc
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
Also if you just starting with Angular and need to now first steps here is another video - czcams.com/video/5juzxptjRhA/video.html
@Watanabe Yasuke that's partially covered in the video description, right? or you would like to see more examples?
It would be great if you can create this also as stackblitz project.
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.