本文整理汇总了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
示例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
]);
示例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,
]);
示例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
]);
示例5: main
export function main() {
return bootstrap(App, [
HTTP_PROVIDERS,
JSONP_PROVIDERS
]);
}
示例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));;
示例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));
示例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]);
示例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));
示例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);