Similar to #7054 it seems that ngAfterViewChecked() is called, when a component is set to OnPush and no input property changed, or event is fired inside that component.
Here's a plunk that demonstrates the issue: http://plnkr.co/edit/3HEH7AcrQaVUF0PTQBNv?p=preview
You'll see two components. One gets bootstrapped and the second one is set to OnPush, so it should only run change detection when either one of its input properties changes, or an event is fired inside that component.
Expectation: OnPush Child Component should not turn green when the button is clicked, as no input properties are changing and no event is fired from inside the child component.
UPDATE: Similar to #7054 ngAfterViewCheck() is called, but change detection is not performed as we can see in this plunk: http://plnkr.co/edit/picW7fedYGY2PIPxp0Ur?p=preview
The subtree of OnPush component is not checked when we trigger CD.
Similar to #7054 it seems that
ngAfterViewChecked()is called, when a component is set toOnPushand no input property changed, or event is fired inside that component.Here's a plunk that demonstrates the issue: http://plnkr.co/edit/3HEH7AcrQaVUF0PTQBNv?p=preview
You'll see two components. One gets bootstrapped and the second one is set to
OnPush, so it should only run change detection when either one of its input properties changes, or an event is fired inside that component.Expectation: OnPush Child Component should not turn green when the button is clicked, as no input properties are changing and no event is fired from inside the child component.
UPDATE: Similar to #7054
ngAfterViewCheck()is called, but change detection is not performed as we can see in this plunk: http://plnkr.co/edit/picW7fedYGY2PIPxp0Ur?p=previewThe subtree of
OnPushcomponent is not checked when we trigger CD.