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


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

本文整理匯總了TypeScript中angular2-universal.bootstrap函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript bootstrap函數的具體用法?TypeScript bootstrap怎麽用?TypeScript bootstrap使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了bootstrap函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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:pjcdarker,項目名稱:angular2-iot,代碼行數:7,代碼來源:index.ts

示例2: setTimeout

setTimeout(function () {
    bootstrap(AppComponent, [HTTP_PROVIDERS]).then(function () { 
        let environment = document.getElementById('environment'); 
        environment.innerText = 'Client';
        environment.setAttribute('class', 'environment environment-client');
    }); 
}, 5000);
開發者ID:fydoh,項目名稱:phoenix-js-meetup,代碼行數:7,代碼來源:client.ts

示例3: main

function main() {
  return bootstrap(App, [
    ...BROWSER_ROUTER_PROVIDERS,
    ...BROWSER_HTTP_PROVIDERS
  ])
  .then(setClientRenderedEl);
}
開發者ID:Erbolking,項目名稱:ng-conf-2016-universal-patterns,代碼行數:7,代碼來源:client.ts

示例4: ngApp

export function ngApp() {

  return bootstrap(App, [
    ...BROWSER_ROUTER_PROVIDERS,
    ...BROWSER_HTTP_PROVIDERS,

    ...BROWSER_STORE_PROVIDERS
  ]);
}
開發者ID:gdi2290,項目名稱:angular-sf-2016-5-13-universal-dependencies,代碼行數:9,代碼來源:main.browser.ts

示例5: main

export function main(): Promise<any> {
  return bootstrap(App, [
    ...PROVIDERS,
    ...ENV_PROVIDERS,
    ...DIRECTIVES,
    ...PIPES,
    ...APP_PROVIDERS
  ])
   .catch(err => console.error(err));
}
開發者ID:gdi2290,項目名稱:universal-angular2-starter,代碼行數:10,代碼來源:main.browser.ts

示例6: setTimeout

setTimeout(function () {
    bootstrap(AppComponent, [...HTTP_PROVIDERS, provideRouter(routes)]).then(function () { 
        let environment = document.getElementById('environment'); 
        environment.innerText = 'Client';
        environment.setAttribute('class', 'environment environment-client');
    })
    // .then(() => {
    //     setTimeout(function() {
    //         prebootComplete
    //     }, 400);
    // })
    ;
}, 5000);
開發者ID:fydoh,項目名稱:phoenix-js-meetup,代碼行數:13,代碼來源:client.ts

示例7: bootstrap

* See: https://angular.io/docs/ts/latest/api/platform/browser/bootstrap-function.html
*
* This also initializes all our application's data providers (e.g. services, etc)
* by passing them to the main component. For more on providers/injection, see this blog post:
* http://blog.thoughtram.io/angular/2015/05/18/dependency-injection-in-angular-2.html
**/
bootstrap(AppComponent, [
    ...BROWSER_ROUTER_PROVIDERS,
    ...BROWSER_HTTP_PROVIDERS,
    provide(TranslateLoader, {
        useFactory: (http: Http) => new TranslateStaticLoader(http, 'i18n', '.json'),
        deps: [ Http ]
    }),
    AuthorizationService,
    BreadcrumbService,
    ContextProviderService,
    DSpaceConstants,
    DSpaceDirectory,
    DSpaceService,
    FormService,
    GoogleScholarMetadataService,
    HttpService,
    MetadataHelper,
    MetaTagService,
    NotificationService,
    PaginationService,
    PagingStoreService,
    StorageService,
    TranslateService
]).then(prebootComplete);
開發者ID:hardyoyo,項目名稱:angular2-ui-prototype,代碼行數:30,代碼來源:main.ts

示例8: bootstrap

import {bootstrap} from "angular2-universal";
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:ferdinandtorggler,項目名稱:ng2-material,代碼行數:13,代碼來源:bootstrap.ts

示例9: enableProdMode

import 'angular2-universal/polyfills';

import {bootstrap, enableProdMode, BROWSER_ROUTER_PROVIDERS, BROWSER_HTTP_PROVIDERS} from 'angular2-universal';

import {App} from './app/app.component';

import {BROWSER_FALCOR_PROVIDERS} from './app/angular2-falcor/browser';

enableProdMode();



bootstrap(App, [
  ...BROWSER_ROUTER_PROVIDERS,
  ...BROWSER_HTTP_PROVIDERS,
  ...BROWSER_FALCOR_PROVIDERS
]);
開發者ID:gdi2290,項目名稱:angular2-falcor-starter,代碼行數:17,代碼來源:client.ts

示例10: bootstrap

import 'angular2-universal/polyfills';

import {bootstrap, BROWSER_ROUTER_PROVIDERS, BROWSER_HTTP_PROVIDERS} from 'angular2-universal';
import {AppComponent} from './appcomponent'

bootstrap(AppComponent, [
	...BROWSER_ROUTER_PROVIDERS,
	...BROWSER_HTTP_PROVIDERS
]);
開發者ID:MarkPieszak,項目名稱:server-side-rendering,代碼行數:9,代碼來源:main.ts


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