当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript platform-browser-dynamic.bootstrap函数代码示例

本文整理汇总了TypeScript中@angular/platform-browser-dynamic.bootstrap函数的典型用法代码示例。如果您正苦于以下问题:TypeScript bootstrap函数的具体用法?TypeScript bootstrap怎么用?TypeScript bootstrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bootstrap函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: bootstrap

/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

import {NG_VALIDATORS} from '@angular/common';
import {bootstrap} from '@angular/platform-browser-dynamic';

class MyApp {}
let myValidator: any = null;

// #docregion ng_validators
bootstrap(MyApp, [{provide: NG_VALIDATORS, useValue: myValidator, multi: true}]);
// #enddocregion
开发者ID:4vanger,项目名称:angular,代码行数:17,代码来源:ng_validators.ts

示例2: require

import { bootstrap}  from '@angular/platform-browser-dynamic';

/*
* App Component
* our top level component that holds all of our components
*/
import { OurApp } from './app';
import { appRouterProviders }   from './app/app.routes';

declare var require: {
    <T>(path: string): T;
    (paths: string[], callback: (...modules: any[]) => void): void;
    ensure: (paths: string[], callback: (require: <T>(path: string) => T) => void) => void;
};

window['Tether'] = 'something';

require('font-awesome/scss/font-awesome.scss');
require('bootstrap/scss/bootstrap.scss');
require('bootstrap/dist/js/bootstrap.js');

bootstrap(OurApp, [
  appRouterProviders
]);

开发者ID:hendricson,项目名称:practical-angular,代码行数:24,代码来源:main.browser.ts

示例3: require

import { HTTP_PROVIDERS } from '@angular/http';

import { APP_BASE_HREF } from '@angular/common/index';
import { NgRedux } from 'ng2-redux';
import { SequencerPage } from './containers/sequencer-page';
import { APP_ROUTER_PROVIDERS } from './app.routes';

import { RioSampleApp } from './containers/sample-app';
import {
  SequenceService,
  SoundService,
} from './services';

declare let __PRODUCTION__: any;

require('style!css!font-awesome/css/font-awesome.css');

if (__PRODUCTION__) {
  enableProdMode();
} else {
  require('zone.js/dist/long-stack-trace-zone');
}

bootstrap(RioSampleApp, [
  NgRedux,
  SoundService,
  SequenceService,
  HTTP_PROVIDERS,
  APP_ROUTER_PROVIDERS,
]);
开发者ID:stevenkampen,项目名称:ng2-sequencer,代码行数:30,代码来源:index.ts

示例4: enableProdMode

import {bootstrap}    from '@angular/platform-browser-dynamic';
import {AppComponent} from './app.component';
import {environment} from './environment';
import {HTTP_PROVIDERS} from '@angular/http';
import {ROUTER_PROVIDERS} from '@angular/router';
import {MdIconRegistry} from '@angular2-material/icon';
import {Renderer} from '@angular/core';
import {MdRadioDispatcher} from '@angular2-material/radio/radio_dispatcher';
import 'rxjs/Rx';

import {enableProdMode} from '@angular/core';

if (environment.production) {
  enableProdMode();
}

bootstrap(AppComponent, [
  ROUTER_PROVIDERS,
  HTTP_PROVIDERS,
  MdIconRegistry,
  Renderer,
  MdRadioDispatcher
]);
开发者ID:samiheikki,项目名称:angular22identio,代码行数:23,代码来源:main.ts

示例5: main

export function main() {
  return bootstrap(App, [
    HTTP_PROVIDERS,
    JSONP_PROVIDERS
  ]);
}
开发者ID:Hyperkind,项目名称:universal,代码行数:6,代码来源:browser.ts

示例6: bootstrap

import 'rxjs/add/operator/toPromise';

// Imports for loading & configuring the in-memory web api
import { XHRBackend } from '@angular/http';

import { bootstrap }    from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';

import { AppComponent } from './app.component';
import { appRouterProviders } from './app.routes';

bootstrap(AppComponent, [
	appRouterProviders
	])
	.catch(err => console.error(err));;
开发者ID:TiagoJSM,项目名称:Angular2_D3,代码行数:15,代码来源:main.ts

示例7: enableProdMode

import { bootstrap }    from '@angular/platform-browser-dynamic';
import { enableProdMode } from "@angular/core";

import { AppComponent } from './app.component';
import { APP_ROUTER_PROVIDERS } from './app.routes';

enableProdMode();

bootstrap(AppComponent, [
  APP_ROUTER_PROVIDERS
])
.catch(error => console.log(error));
开发者ID:Daynil,项目名称:fcc-pinboard,代码行数:12,代码来源:main.ts

示例8: bootstrap

import {bootstrap} from '@angular/platform-browser-dynamic';
import {UserService} from './user-service';
import {AppComponent} from './app-component';
import {LoginService} from './login-service';


bootstrap(AppComponent, [LoginService, UserService]);
开发者ID:FernandoVezzali,项目名称:ng2-test-seed,代码行数:7,代码来源:bootstrap.ts

示例9: bootstrap

import { PathLocationStrategy } from '@angular/common';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { HTTP_PROVIDERS } from '@angular/http';

import {SeedApp} from './app/seed-app';

import { storeProvider } from './app/reducers/router.reducer';
import { connectRouterToStore } from '@ngrx/router-store';
import { provideRouter } from '@ngrx/router';
import { ROUTES } from './routes';


// enableProdMode()

bootstrap(SeedApp, [
  HTTP_PROVIDERS,
  storeProvider,
  provideRouter(ROUTES, PathLocationStrategy),
  connectRouterToStore()
])
.catch(err => console.error(err));
开发者ID:przemek-k,项目名称:ng2-redux-ngrx,代码行数:22,代码来源:app.ts

示例10: enableProdMode

import { bootstrap } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { XwingNgAppComponent, environment } from './app/';

if (environment.production) {
  enableProdMode();
}

bootstrap(XwingNgAppComponent);

开发者ID:ultish,项目名称:xwing-ng,代码行数:9,代码来源:main.ts


注:本文中的@angular/platform-browser-dynamic.bootstrap函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。