Since ChangeDetectionStrategy.OnPushchange detection is performed in the child component, when the value of the child component has been updated @Input(), the event received by the child component has been received, (someEvent)="..."or the event has been selected @HostListener(...)to use the observed border to use the tube | async.
To run the code when changing @Input(), you can either enter setter or implement it OnChangesfor the code that will be executed during updates.
For events, just call your code in the event handler.
For observables, you can apply a type operator .map(...)to your code, which will execute when the values are emitted.
source
share