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

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.

主站蜘蛛池模板: 兴仁县| 绍兴市| 苍溪县| 曲麻莱县| 高邑县| 湘潭市| 万山特区| 安化县| 清远市| 临洮县| 秭归县| 八宿县| 博乐市| 南昌市| 伊金霍洛旗| 文水县| 仪征市| 呼和浩特市| 文登市| 阿鲁科尔沁旗| 土默特右旗| 华亭县| 安塞县| 沙雅县| 镇远县| 洛南县| 临沂市| 建湖县| 仁怀市| 巩留县| 古交市| 九江县| 乐亭县| 家居| 乌什县| 宁南县| 福州市| 平阳县| 梅河口市| 奈曼旗| 科尔|