Tutorial by Examples

NgZone reference can be injected via the Dependency Injection (DI). my.component.ts import { Component, NgOnInit, NgZone } from '@angular/core'; @Component({...}) export class Mycomponent implements NgOnInit { constructor(private _ngZone: NgZone) { } ngOnInit() { this._ngZone.runO...
runOutsideAngular can be used to run code outside Angular 2 so that it does not trigger change detection unnecessarily. This can be used to for example run multiple HTTP request to get all the data before rendering it. To execute code again inside Angular 2, run method of NgZone can be used. my.com...

Page 1 of 1