本文整理汇总了TypeScript中@angular/platform-browser-dynamic.platformBrowserDynamic函数的典型用法代码示例。如果您正苦于以下问题:TypeScript platformBrowserDynamic函数的具体用法?TypeScript platformBrowserDynamic怎么用?TypeScript platformBrowserDynamic使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了platformBrowserDynamic函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: platformBrowserDynamic
{ path: 'contact', component: ContactComponent },
{ path: 'protected', component: ProtectedComponent,
canActivate: [LoggedInGuard]}
];
@NgModule({
declarations: [
RoutesDemoApp,
HomeComponent,
AboutComponent,
ContactComponent,
ProtectedComponent,
LoginComponent
],
imports: [
BrowserModule,
FormsModule,
RouterModule.forRoot(routes) // <-- routes
],
bootstrap: [ RoutesDemoApp ],
providers: [
AUTH_PROVIDERS,
LoggedInGuard,
{ provide: LocationStrategy, useClass: HashLocationStrategy },
]
})
class RoutesDemoAppModule {}
platformBrowserDynamic().bootstrapModule(RoutesDemoAppModule)
.catch((err: any) => console.error(err));
示例2: platformBrowserDynamic
///<reference path="./../../../typings/index.d.ts"/>
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './module';
platformBrowserDynamic().bootstrapModule(AppModule).then((result) => {
// console.log('result', result);
console.log('Bootstrap loaded');
});
示例3: platformBrowserDynamic
import { enableProdMode } from "@angular/core";
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import { AppModule } from "./app.module";
//enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
示例4: platformBrowserDynamic
.then(() => {
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
})
示例5: enableProdMode
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { enableAkitaProdMode } from '@datorama/akita';
if (environment.production) {
enableProdMode();
enableAkitaProdMode();
}
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.log(err));
示例6: platformBrowserDynamic
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {CatalogModule} from './catalog.module';
platformBrowserDynamic().bootstrapModule(CatalogModule);
示例7: platformBrowserDynamic
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import 'bootstrap/dist/css/bootstrap.css';
// App component
import { SampleDateAppModule } from "./sample-date-app/index";
platformBrowserDynamic().bootstrapModule(SampleDateAppModule);
示例8: enableProdMode
import 'reflect-metadata';
import 'babel-polyfill';
import 'core-js/es6';
import 'core-js/es7/reflect';
import '../shims/shims_for_IE';
import 'zone.js/dist/zone';
import 'ts-helpers';
// The browser platform with a compiler
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
// The app module
import {RioSampleAppModule} from './app/sample-app.module';
import {enableProdMode} from '@angular/core';
if (__PRODUCTION__) {
enableProdMode();
} else {
require('zone.js/dist/long-stack-trace-zone');
}
if (!__TEST__) {
// Compile and launch the module
platformBrowserDynamic().bootstrapModule(RioSampleAppModule);
}
示例9: platformBrowserDynamic
document.body.addEventListener('bootstrap', () => {
platformBrowserDynamic().bootstrapModule(AppModule);
});
示例10: main
export function main() {
platformBrowserDynamic().bootstrapModule(ExampleModule);
}