Skip to content
Learn Netverks

Lesson

Step 29/36 81% through track

change-detection

Change detection

Last reviewed May 28, 2026 Content v20260528
Track mode
client_angular
Means
In-browser Angular TS
Reading
~1 min
Level
advanced

This lesson

This lesson teaches Change detection: the concepts, APIs, and habits you need before advancing in Angular.

Without Change detection, you will struggle to read or extend Angular codebases and playground exercises.

You will apply Change detection in contexts like: Large Angular codebases, line-of-business apps, and teams standardized on TypeScript everywhere.

Write TypeScript with decorators, click Run—Angular 19 loads from CDN, use the Ng global and mountApp(Component) with selector app-root; printOutput feeds the terminal.

When hooks, state, and effects from intermediate lessons are familiar.

Change detection is how Angular knows to refresh templates when state changes. The default strategy checks components on most browser events; ChangeDetectionStrategy.OnPush limits checks to input changes, events, and signal updates.

Why OnPush matters

  • Large tables and dashboards avoid redundant template work
  • Pairs well with immutable inputs and signals
  • Requires discipline—mutating objects in place without signals may not update UI

Signals and CD

Reading a signal in a template registers a dependency—when the signal changes, Angular marks the view dirty efficiently.

Important interview questions and answers

  1. Q: Default vs OnPush?
    A: Default checks broadly; OnPush checks when inputs/signals/events trigger the component.
  2. Q: Does OnPush mean “never updates”?
    A: No—it still updates when inputs change, DOM events fire, or async pipe emits.

Self-check

  1. When would you reach for OnPush on a list row component?
  2. How do signals reduce surprise stale UI with OnPush?

Interview prep

OnPush change detection?

Checks a component only when inputs change, events fire, or signals update—reduces work in large trees.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • OnPush when?
  • Signals + CD?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump