Complete the code to import Zone.js for Angular automatic change detection.
import '[1]';
Zone.js is imported to enable Angular's automatic change detection.
Complete the code to run a function outside Angular's zone.
this.ngZone.[1](() => { console.log('Running outside Angular zone'); });
runOutsideAngular lets you execute code without triggering Angular change detection.
Fix the error in the code to correctly inject NgZone in the constructor.
constructor(private [1]: NgZone) {}The common and recommended name for the injected NgZone is 'ngZone'.
Fill both blanks to create a subscription that runs outside Angular's zone.
this.ngZone.[1](() => { observable.[2](value => { console.log(value); }); });
runOutsideAngular runs code outside Angular's zone, and subscribe listens to observable values.
Fill all three blanks to manually trigger change detection after running outside Angular.
this.ngZone.[1](() => { // some async work this.data = newData; this.cd.[2](); this.ngZone.[3](() => {}); });
runOutsideAngular runs code outside Angular, detectChanges triggers change detection manually, and run re-enters Angular zone.