Angular - Performance Optimization
Identify the error in this component using
Why might the template not update after calling
OnPush strategy:@Component({
selector: 'app-test',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `{{ title }}`
})
export class TestComponent {
title = 'Hello';
updateTitle() {
this.title = 'World';
}
}Why might the template not update after calling
updateTitle()?