Skip to solution
hardFrontend

What is Zone.js, how does it monkey-patch browser APIs, and how do you build a Zoneless Angular application?

814 views
01

Understand the problem

Explain Zone.js, dirty checking, and building applications without Zones in Angular 18.

performancezoneless
02

Attempt it yourself

Sketch your approach before reading the solution — that's what interviews test.

Nudge consolestandby

Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.

03

Study the solution

Zone.js wraps browser async APIs (events, timers, HTTP) to trigger automatic change detection. In Angular 18, you can build a Zoneless application using provideExperimentalZonelessChangeDetection() and signals, removing Zone.js overhead.

Solution ready — 2 min read

Classified // press E to declassify

04

Read the code

Bootstrapping a Zoneless application in Angular 18
import { bootstrapApplication } from '@angular/platform-browser';
import { provideExperimentalZonelessChangeDetection, Component, signal } from '@angular/core';

@Component({
  selector: 'app-root',
  standalone: true,
  template: '<button (click)="inc()">Count: {{ count() }}</button>'
})
class AppComponent {
  count = signal(0);
  inc() { this.count.update(c => c + 1); }
}

bootstrapApplication(AppComponent, {
  providers: [
    provideExperimentalZonelessChangeDetection()
  ]
});
05

Join the discussion

Discussion (0)

Sign in to join the discussion.

No responses yet. Be the first to share what you think.

Transmission complete // awaiting log

KEEP THE
STREAK ALIVE.

Dossier 93 of 121 decoded in the Angular track. One more won't hurt.

Back to track