本文整理匯總了TypeScript中angular2-universal-preview.bootstrap函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript bootstrap函數的具體用法?TypeScript bootstrap怎麽用?TypeScript bootstrap使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了bootstrap函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: bootstrap
export function bootstrap(appComponentType: any, appProviders: Array<Type | Provider | any | any[]> = []): Promise<ComponentRef> {
let combinedProviders = [
IOT_PROVIDERS,
...appProviders
];
return bootstrapUniversal(appComponentType, combinedProviders);
}
示例2: bootstrap
// import {bootstrap} from 'angular2/platform/browser';
import {bootstrap} from 'angular2-universal-preview';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {App} from './app/app';
bootstrap(App, [
...ROUTER_PROVIDERS
]);
示例3: bootstrap
import {Component} from 'angular2/core';
import {bootstrap} from 'angular2-universal-preview';
import {App} from './app';
bootstrap(App);
示例4: bootstrap
import 'reflect-metadata';
import 'zone.js/dist/zone-microtask';
import 'zone.js/dist/long-stack-trace-zone';
import {bootstrap} from 'angular2-universal-preview';
import {ComponentRef} from 'angular2/core';
import {HTTP_PROVIDERS} from 'angular2/http';
import {FORM_PROVIDERS} from 'angular2/common';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {APP_SERVICES_PROVIDERS, IdentityService, Storage} from "./app/common/services/services";
import {App} from './app/app';
const PROVIDERS = [
...HTTP_PROVIDERS,
...FORM_PROVIDERS,
...ROUTER_PROVIDERS,
...APP_SERVICES_PROVIDERS
];
bootstrap(App, PROVIDERS)
.then((appRef: ComponentRef) => {
let storage: Storage = appRef.injector.get(Storage);
let identity: IdentityService = appRef.injector.get(IdentityService);
storage.initStorage(window.localStorage);
storage.getItem("authorizationData").then((value) => {
identity.update(JSON.parse(value));
})
}, error => console.log(error))
示例5: bootstrap
import {bootstrap} from "angular2-universal-preview";
import {ROUTER_PROVIDERS} from "angular2/router";
import {MATERIAL_NODE_PROVIDERS} from "ng2-material/all";
import {HTTP_PROVIDERS} from "angular2/http";
import {ComponentsService} from "../../services/components";
import {NavigationService} from "../../services/navigation";
import {VersionService} from "../../services/version";
import {DemosApp} from "../../app";
bootstrap(DemosApp, [
HTTP_PROVIDERS, ROUTER_PROVIDERS, MATERIAL_NODE_PROVIDERS,
ComponentsService, NavigationService, VersionService
]);