Overview - When to use OnPush
What is it?
OnPush is a change detection strategy in Angular that tells the framework to check a component's view only when its input properties change or when an event happens inside it. Instead of checking every component all the time, Angular checks only when it really needs to. This helps make apps faster and more efficient by reducing unnecessary work.
Why it matters
Without OnPush, Angular checks every component on every change, which can slow down apps, especially big ones. OnPush helps apps run smoothly by skipping checks when nothing relevant has changed. This means users get faster responses and better experiences, especially on slower devices or complex apps.
Where it fits
Before learning OnPush, you should understand Angular components, data binding, and the default change detection process. After mastering OnPush, you can explore advanced performance optimization techniques and reactive programming with RxJS in Angular.