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

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.

主站蜘蛛池模板: 蓬莱市| 廊坊市| 永川市| 香港| 澄城县| 上犹县| 郸城县| 陈巴尔虎旗| 沛县| 丹东市| 邢台县| 哈密市| 盐亭县| 益阳市| 光泽县| 清丰县| 四平市| 化州市| 弋阳县| 深泽县| 茂名市| 民乐县| 革吉县| 揭东县| 客服| 周口市| 庆阳市| 盘锦市| 嫩江县| 若尔盖县| 龙胜| 阳山县| 耒阳市| 稻城县| 五河县| 长宁县| 佛教| 年辖:市辖区| 滁州市| 平遥县| 柯坪县|