A

Admin • 833.24K Points
Coach

Q. How do you mark a component to use OnPush change detection?

  • (A) Add changeDetection: ChangeDetectionStrategy.OnPush in @Component
  • (B) Add @OnPush decorator to class
  • (C) Import OnPushModule
  • (D) Use ngOnChanges lifecycle hook
  • Correct Answer - Option(A)
  • Views: 32
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin

OnPush strategy improves performance by checking only when input references change.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.