How to start the lifecycle of a component when using noop zone?

Discussão em 'Angular' iniciado por Mursaat, Agosto 17, 2025.

  1. Mursaat

    Mursaat Guest

    I'm trying to use noop zone in my Angular application, but when I route to a component, it is not initialized. The constructor is called, but the lifecycle is not started and ngOnInit is not called.

    Here is an application (with zone.js enabled) in which my AppComponent has a router-outlet. We are directly routed to the HelloComponent component, and it initializes correctly : https://stackblitz.com/edit/angular-hlcf5g

    Now, here is the same app but I use { ngZone: 'noop' } in main.ts : https://stackblitz.com/edit/angular-pseswv

    {{title}} is not working an ngOnInit is not called.

    Continue reading...

Compartilhe esta Página