lazy-ng-zone
v1.0.9
Published
Postpone zone download and bootstrap.
Downloads
2
Readme
What does this package do?
Use this package to postpone zone.js download and bootstrap until the moment you chose to do so.
The download & bootstrap of zone takes precious time in application bootstrap. Since Angular bootstrap is independent of zone, there's no reason to have its dependency in bootstrap.
How to use this package?
npm install --save-dev lazy-ng-zone
Add this provider in your AppModule:
(e.g - here we download & bootstrap zone after 10 seconds)
{ provide: NgZone, useValue: LazyNgZone.LazyNgZone.create(timer(10000)) }
Add ngZone option in main.ts:
platformBrowserDynamic().bootstrapModule(AppModule, { ngZone: LazyNgZone.LazyNgZone.get })
Comment this line in polyfills.ts:
// import 'zone.js/dist/zone'; // Included with Angular CLI.
For any issues, Please contant me in [email protected]. Thanks!