Angular - Performance Optimization
Given this component with
What happens if the parent updates
OnPush strategy:@Component({
selector: 'app-sample',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `{{ counter }}`
})
export class SampleComponent {
@Input() counter = 0;
}What happens if the parent updates
counter by changing its value from 1 to 2?