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


TypeScript browser.bootstrap函数代码示例

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


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

示例1: constructor

import {bootstrap}    from 'angular2/platform/browser';     //for bootstraping
import {Component} from 'angular2/core';                    //for components

import {SampleService} from './sampleService';          //import service

@Component({
    selector: 'main-selector',
    template: `<br/> <h3>Main Component</h3>
                <ul><li *ngFor="#v of myList">{{v}}</li></ul>`,
    providers: [SampleService]
})
export class MainComponent {
    myList: string[];
    
    constructor(public myService: SampleService) {
            this.myList = myService.getSampleData();  
    } 
    
}



bootstrap(MainComponent);
开发者ID:shazy655,项目名称:ng2,代码行数:23,代码来源:main.ts

示例2: enableProdMode

import {bootstrap}    from 'angular2/platform/browser';
import {enableProdMode} from 'angular2/core';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {HTTP_PROVIDERS} from 'angular2/http';
import {BackendService} from './app/services/backend';
import {MainComponent} from './app/main';

if ('development' !== process.env.ENV) {
  enableProdMode();
}

bootstrap(MainComponent, [ROUTER_PROVIDERS, HTTP_PROVIDERS, BackendService]);
开发者ID:rodrigouroz,项目名称:angular2-presentation,代码行数:12,代码来源:bootstrap.ts

示例3: bootstrap

import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';

bootstrap (AppComponent)
.then (success => console.log('Bootstrap successfully!'))
.catch(err => console.log(err));
开发者ID:laudrup69,项目名称:Angular2,代码行数:6,代码来源:boot.ts

示例4: bootstrap

import {bootstrap} from 'angular2/platform/browser'
import {Component} from 'angular2/core';
import {TodoService} from "./todo/services/todo-service";
import {TodoInput} from './todo/components/todo-input';
import {TodoList} from "./todo/components/todo-list";
import {StatusSelector} from "./todo/components/status-selector";
import {SearchBox} from "./todo/components/search-box";

@Component({
  selector: 'todo-app',
  directives: [TodoInput, TodoList, StatusSelector, SearchBox],
  template: `<div>
    <search-box (update)="term = $event"></search-box>
    <todo-input></todo-input>
    <status-selector (select)="status = $event"></status-selector>
    <todo-list [status]="status" [term]="term"></todo-list>
  </div>`
})
class TodoApp{}
bootstrap(TodoApp, [TodoService]);
开发者ID:DotHide,项目名称:angular2-quickstart,代码行数:20,代码来源:main.ts

示例5: bootstrap

import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app/app.component';
import {ROUTER_PROVIDERS} from 'angular2/router';
// import {enableProdMode} from 'angular2/core';

bootstrap(AppComponent, [
  ROUTER_PROVIDERS
]);

// enableProdMode();
开发者ID:beeva-miguelsarries,项目名称:angular2-cli,代码行数:10,代码来源:bootstrap.ts

示例6: bootstrap

import {bootstrap}    from 'angular2/platform/browser';
import {AppComponent} from './app.component';
import {HeroService}  from './heroes/hero.service';

//#docregion bootstrap
// Injecting services in bootstrap works but is discouraged
bootstrap(AppComponent, [HeroService]);
//#enddocregion bootstrap
开发者ID:austinglenn,项目名称:angular.io,代码行数:8,代码来源:main.1.ts

示例7: constructor

import {AUTH_PROVIDERS} from 'angular2-jwt';

import {Home} from './home.component';
import {Ping} from './ping.component';
import {Profile} from './profile.component';
import {Auth} from './auth.service';

@Component({
  selector: 'app',
  providers: [ Auth ],
  directives: [ ROUTER_DIRECTIVES ],
  templateUrl: 'src/app.template.html',
  styles: [`.btn-margin { margin-top: 5px}`]
})
@RouteConfig([
  { path: '/home',  name: 'Home',  component: Home, useAsDefault: true },
  { path: '/ping',  name: 'Ping',  component: Ping },
  { path: '/profile',  name: 'Profile',  component: Profile }
])
export class App {

  constructor(private auth: Auth) {}

}

bootstrap(App, [
  HTTP_PROVIDERS,
  ROUTER_PROVIDERS,
  AUTH_PROVIDERS,
  provide(LocationStrategy, { useClass: HashLocationStrategy })
])
开发者ID:christiannwamba,项目名称:auth0-angular2,代码行数:31,代码来源:app.component.ts

示例8: bootstrap

import {bootstrap} from 'angular2/platform/browser';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {HeroService} from './hero.service';
import {AppComponent} from './app.component';

bootstrap(AppComponent, [
  ROUTER_PROVIDERS,
  HeroService
]);



/*
Copyright 2016 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 http://angular.io/license
*/
开发者ID:julianlopezv,项目名称:AngularJS,代码行数:17,代码来源:main.ts

示例9: bootstrap

import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from "./app.component";
import {HTTP_PROVIDERS} from "angular2/http";
import {WeatherService} from './weather/weather.service';

bootstrap(AppComponent, [HTTP_PROVIDERS, WeatherService]);
开发者ID:Radeg,项目名称:a2-weather-app,代码行数:6,代码来源:boot.ts

示例10: bootstrap

ďťżimport { bootstrap } from "angular2/platform/browser";
import { MyApp } from "./app";
bootstrap(MyApp);
开发者ID:volyasmith,项目名称:dating_site,代码行数:3,代码来源:main.ts


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