How to apply ChangeDetectionStrategy onPush to tens of thousands of components in existing application?

Viewed 51

I have Angular application with tens of thousands of components I get from my client.

@Component({
  selector: '...',
  templateUrl: '...',
  styleUrls: ['...'],
})
export class Component implements OnInit { ...

And now I want to add changeDetection: ChangeDetectionStrategy.OnPush to every component I have:

@Component({
  selector: '...',
  templateUrl: '...',
  styleUrls: ['...'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class Component implements OnInit { ...

To do this for every file/component it's exhausting.

Is there be a way to do it with bash script or cli command?

0 Answers
Related