當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angular2-universal-preview.bootstrap函數代碼示例

本文整理匯總了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);
}
開發者ID:QuinntyneBrown,項目名稱:angular2-iot,代碼行數:7,代碼來源:index.ts

示例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
]);
開發者ID:Shkryob,項目名稱:universal-starter,代碼行數:9,代碼來源:client.ts

示例3: bootstrap

import {Component} from 'angular2/core';
import {bootstrap} from 'angular2-universal-preview';

import {App}  from './app'; 


bootstrap(App);
開發者ID:bigbassroller,項目名稱:ng2-play-universal,代碼行數:7,代碼來源:bootstrap.ts

示例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))
開發者ID:cm0s,項目名稱:mea2n,代碼行數:30,代碼來源:client_browser.ts

示例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
]);
開發者ID:dmacfarlane,項目名稱:ng2-material,代碼行數:13,代碼來源:bootstrap.ts


注:本文中的angular2-universal-preview.bootstrap函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。