- Essential Angular
- Victor Savkin Jeff Cross
- 91字
- 2021-07-02 22:56:27
Bootstrap
To bootstrap an Angular application in the JIT mode, you pass a module to bootstrapModule:
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app';
platformBrowserDynamic().bootstrapModule(AppModule);
This will compile AppModule into a module factory and then use the factory to instantiate the module. If you use AOT, you may need to provide the factory yourself:
import {platformBrowser} from '@angular/platform-browser';
import {AppModuleNgFactory} from './app.ngfactory';
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
I said "may need to" because the CLI and the WebPack plugin take care of it for you. They will replace the bootstrapModule call with bootstrapModuleFactory when needed.
推薦閱讀
- 微信公眾平臺與小程序開發:從零搭建整套系統
- Instant Apache Stanbol
- Cocos2d-x游戲開發:手把手教你Lua語言的編程方法
- Apache Spark 2.x Machine Learning Cookbook
- 趣學Python算法100例
- PHP 編程從入門到實踐
- CKA/CKAD應試教程:從Docker到Kubernetes完全攻略
- 深入淺出PostgreSQL
- PHP從入門到精通(第4版)(軟件開發視頻大講堂)
- Test-Driven Machine Learning
- Swift 4從零到精通iOS開發
- 快速入門與進階:Creo 4·0全實例精講
- 微課學人工智能Python編程
- Building Dynamics CRM 2015 Dashboards with Power BI
- C++程序設計教程(第2版)