- 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.
推薦閱讀
- Java面向對象思想與程序設計
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- Instant 960 Grid System
- 假如C語言是我發明的:講給孩子聽的大師編程課
- FLL+WRO樂高機器人競賽教程:機械、巡線與PID
- Mathematica Data Analysis
- 數據結構習題解析與實驗指導
- ExtJS高級程序設計
- Python 3 數據分析與機器學習實戰
- Solutions Architect's Handbook
- HTML5 Canvas核心技術:圖形、動畫與游戲開發
- Natural Language Processing with Python Cookbook
- Learning Puppet
- Learning Google Apps Script
- iOS應用逆向工程:分析與實戰