本文整理匯總了TypeScript中@angular/platform/browser.bootstrap函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript bootstrap函數的具體用法?TypeScript bootstrap怎麽用?TypeScript bootstrap使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了bootstrap函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: enableProdMode
import {bootstrap} from '@angular/platform/browser';
import {enableProdMode} from '@angular/core';
import {HTTP_PROVIDERS} from '@angular/http';
import {ROUTER_PROVIDERS} from '@angular/router';
if (webpack.ENV === 'production') {
enableProdMode();
}
import {MyApp} from './app/app';
bootstrap(MyApp, [
...HTTP_PROVIDERS,
...ROUTER_PROVIDERS
]).catch(console.error.bind(console));
示例2: bootstrap
import { bootstrap } from '@angular/platform/browser';
import { provide } from '@angular/core';
import { HTTP_PROVIDERS } from '@angular/http';
import { MyApp } from './app';
import {TRANSLATE_PROVIDERS, TranslateService,TranslateStaticLoader,TranslateLoader} from "ng2-translate/ng2-translate";
bootstrap(MyApp, [
HTTP_PROVIDERS,
TRANSLATE_PROVIDERS
]);
示例3: bootstrap
import {bootstrap} from '@angular/platform/browser';
import {enableProdMode} from '@angular/core';
import {AppComponent} from './app.component';
// enableProdMode();
bootstrap(AppComponent);
示例4: bootstrap
import {bootstrap} from '@angular/platform/browser';
import {HTTP_PROVIDERS} from '@angular/http';
import {ROUTER_PROVIDERS} from '@angular/router';
import {MyApp} from './components/app';
bootstrap(MyApp, [
...HTTP_PROVIDERS, // using spread operator
...ROUTER_PROVIDERS
]).catch((console) => console.error(console));