Hello, I think if u use the async pipe in html component you will be detect changes without using the changeDetectorRef and you will not use the ngdestroy life cycle hooks Because the async pipe do the unsbscription at the end of html rendering process
Hi sir, This is Ramya. Change Detection occurs in parent to child component or any other components which is not having any parent child communication ? This is my doubt
That's because the Angular change detection cycle (the process by which Angular compares the component tree with its own internal view of said tree, to detect if there was any change) is done twice in DEV mode (not in PROD). This check is done by reference (like for all objects and array in javascript), which is also why the data doesn't show in the video: when he does 3:00 "this.posts = data", the reference to "this.posts" is not changed. He's simply making the "posts" variable point to the object "data", containing the data, which is why the internal data is clearly changed as seen in the console. To make sure Angular picks up the change, it's only necessary to make sure the reference to "this.posts" is changed, for example by using the spread operator and doing something like "this.posts = {...data}". I think it is well explained here : th-cam.com/video/-tB-QDrPmuI/w-d-xo.htmlsi=WgfOOnGqaoFU5AcP&t=149
Thank you, Leela. I was crying about this onPush soo long.
Well explained with an ease
One of the best video.. I have ever watched.. very good explanation
Very well explained about Change Detection Strategy in Angular
Thank you . You have explained the concept clearly..
Thanks sir please don't stop posting videos
thanks, good explain
well explained...
Hello,
I think if u use the async pipe in html component you will be detect changes without using the changeDetectorRef and you will not use the ngdestroy life cycle hooks
Because the async pipe do the unsbscription at the end of html rendering process
Helpful 🙂
thank you so much, but can you make future video in hindi to beginners well understand...
Thank you Sir , your videos are so helpful , keep going (:
Very good video. Thank you. could you please paste the continuation video link..
Hi sir,
This is Ramya. Change Detection occurs in parent to child component or any other components which is not having any parent child communication ? This is my doubt
Could someone please explain to me why there are four consoles at the initial load? Shouldn't there be only two?
That's because the Angular change detection cycle (the process by which Angular compares the component tree with its own internal view of said tree, to detect if there was any change) is done twice in DEV mode (not in PROD).
This check is done by reference (like for all objects and array in javascript), which is also why the data doesn't show in the video: when he does 3:00 "this.posts = data", the reference to "this.posts" is not changed. He's simply making the "posts" variable point to the object "data", containing the data, which is why the internal data is clearly changed as seen in the console. To make sure Angular picks up the change, it's only necessary to make sure the reference to "this.posts" is changed, for example by using the spread operator and doing something like "this.posts = {...data}".
I think it is well explained here : th-cam.com/video/-tB-QDrPmuI/w-d-xo.htmlsi=WgfOOnGqaoFU5AcP&t=149
Please where is the continuation of the ChangeDetection topic?
This whole playslist has the videos
ChangeDetectorRef
I appreciate your videos, but I find it difficult to understand you sometimes because of your accent and the speed at which you speak
I am trying to Improve my way of speaking