本文整理汇总了TypeScript中@angularclass/hmr.bootloader函数的典型用法代码示例。如果您正苦于以下问题:TypeScript bootloader函数的具体用法?TypeScript bootloader怎么用?TypeScript bootloader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bootloader函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: enableProdMode
import './polyfills.browser';
import './rxjs.imports';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootloader } from '@angularclass/hmr';
import { AppModule } from './app/app.module';
import { decorateModuleRef } from './environment';
if ('production' === ENV) {
enableProdMode();
}
export function main(): Promise<any> {
return platformBrowserDynamic()
.bootstrapModule(AppModule)
.then(decorateModuleRef)
.catch(err => console.error(err));
}
// needed for hmr
// in prod this is replace for document ready
bootloader(main);
开发者ID:Ecafracs,项目名称:flatthirteen,代码行数:23,代码来源:main.browser.ts
示例2: main
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootloader } from '@angularclass/hmr';
import { AppModule } from './module';
export function main(): Promise<any> {
return platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));
}
if(HMR) bootloader(main);
if(!HMR) main();
开发者ID:anisharknair,项目名称:ngx-datatable,代码行数:13,代码来源:bootstrap.ts
示例3: enableProdMode
// import "zone.js/dist/zone-node.js";
import {enableProdMode} from "@angular/core";
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
import {AppModule} from "./app/app.module";
import {bootloader} from "@angularclass/hmr";
if (__IS_PROD_MODE__) {
enableProdMode();
}
function startApplication(){
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
}
bootloader(startApplication);
开发者ID:jekill,项目名称:mycv-ng,代码行数:20,代码来源:bootstrap.ts
示例4: hmrOnDestroy
}
if ('restoreInputValues' in store) { store.restoreInputValues(); }
this.appRef.tick();
Object.keys(store).forEach(prop => delete store[prop]);
}
hmrOnDestroy(store) {
const cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement);
this.store.first().subscribe(s => store.rootState = s);
store.disposeOldHosts = createNewHosts(cmpLocation);
store.restoreInputValues = createInputTransfer();
removeNgStyles();
}
hmrAfterDestroy(store) {
store.disposeOldHosts();
delete store.disposeOldHosts;
}
}
console.log('[BASE] DEVELOPMENT MODE');
export function bootstrapApp() {
platformBrowserDynamic()
.bootstrapModule(DevelopmentModule)
.catch((err) => console.error(err));
}
bootloader(bootstrapApp);
开发者ID:atSistemas,项目名称:angular-base,代码行数:30,代码来源:index.ts
注:本文中的@angularclass/hmr.bootloader函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论