- 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.
推薦閱讀
- FuelPHP Application Development Blueprints
- Learn TypeScript 3 by Building Web Applications
- LabVIEW 2018 虛擬儀器程序設計
- 編程的修煉
- Azure IoT Development Cookbook
- 騰訊iOS測試實踐
- MATLAB圖像處理超級學習手冊
- Flash CS6中文版應用教程(第三版)
- 劍指Java:核心原理與應用實踐
- Building Android UIs with Custom Views
- 區塊鏈技術與應用
- jQuery炫酷應用實例集錦
- Learning Unreal Engine Android Game Development
- Python網絡爬蟲技術與應用
- Backbone.js Testing