Angular OnPush Change Detection Strategy: An Illustrated Guide

Ah, change detection — the “magic” that makes Angular applications tick, literally.

For those unfamiliar with the term, it is the process through which Angular detects changes. (duh)

You know… checking to see whether the application state has changed, and if any DOM needs to be updated.

There are two ways this can happen, which are called strategies:

  • the Default strategy, and
  • the OnPush strategy.

In this article, we will study the two change detection strategies of Angular. We will use illustrations to explain how these two work. By the end of this article, you will know how the OnPush strategy works in many different scenarios.

Let’s get started!

Website