官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 涿鹿县| 子长县| 潢川县| 高邑县| 新邵县| 焉耆| 桓台县| 临泉县| 甘孜县| 永仁县| 闸北区| 武山县| 宁都县| 忻城县| 木里| 新河县| 疏勒县| 五大连池市| 上饶市| 唐山市| 吉木萨尔县| 富蕴县| 平利县| 太原市| 团风县| 同仁县| 根河市| 广饶县| 攀枝花市| 当雄县| 鸡东县| 仁化县| 武威市| 临泽县| 宝坻区| 富阳市| 肇源县| 五寨县| 海淀区| 喀喇沁旗| 岫岩|