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


TypeScript angular2.bootstrap函數代碼示例

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


在下文中一共展示了bootstrap函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: bootstrap

import {bootstrap} from 'angular2/angular2';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {HTTP_PROVIDERS} from 'angular2/http';

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

import {BaseService} from './components/baseServices/base.service';

import {ViewbagService} from './components/viewbag/viewbag.service';

bootstrap(App, [
  ROUTER_PROVIDERS, HTTP_PROVIDERS, BaseService, ViewbagService
]);

開發者ID:A-Kamaee,項目名稱:ng2-bootstrap-sbadmin,代碼行數:13,代碼來源:bootstrap.ts

示例2: bootstrap

import {bootstrap, Component} from "angular2/angular2";
import {TodoInput} from "./todoInput";
import {TodoService} from "./todoService";
import {TodoList} from "./todoList";

@Component({
    selector:'app',
    directives: [TodoInput, TodoList],
    template: `
        <div>
        <todo-input></todo-input>
        <todo-list></todo-list>
        </div>
    `
})
class App{}

bootstrap(App, [TodoService]);
開發者ID:Cod1ngNinja,項目名稱:egghead-angular2-london-workshop-master,代碼行數:18,代碼來源:main.ts

示例3: constructor

		this.checked = false;
	}
}

class TodoList {
	items: Todo[];
	constructor() {
		this.items = [];
	};
	remove(item) {
		var idx = this.items.indexOf(item);
        this.items.splice(idx, 1);
	};
	add(item) {
		if (!this.containsByName(item)) {
			this.items.push(item);
		}
	};
	containsByName(item) {
		for (var i = 0; i < this.items.length; ++i) {
			if (this.items[i].name == item.name) {
				return true;
			}
		}
		return false;
	}
}


bootstrap(TodoAppComponent);		
開發者ID:tanou73,項目名稱:Angular2POC,代碼行數:30,代碼來源:app.ts

示例4: constructor

/// <reference path="typings/angular2/angular2.d.ts" />

import {Component, View, bootstrap} from 'angular2/angular2';
import{DemoPage} from './demo-page';

@Component({
   selector: 'demo-app'
})

@View({
    template: '<demo-page></demo-page>',
    directives:[DemoPage]
})

class MyDemoApp {

    constructor() {

    }
}

bootstrap(MyDemoApp);
開發者ID:EdsonF,項目名稱:angular-2-samples,代碼行數:22,代碼來源:app.ts

示例5: bootstrap

// #docregion
// #docregion import
import {Component, View, bootstrap} from 'angular2/angular2';
// #enddocregion

@Component({
  selector: 'my-app'
})
@View({
  template: '<h1 id="output">My first Angular 2 App</h1>'
})
class AppComponent {
}
// #docregion bootstrap
bootstrap(AppComponent);
// #enddocregion
開發者ID:2947721120,項目名稱:angular-cn-1,代碼行數:16,代碼來源:main.ts

示例6: constructor

import {Dashboard} from './components/dashboard/dashboard';
import {Login} from './components/login/login';

@Component({
	selector: 'app'
})
@View({
	directives: [ RouterOutlet, RouterLink ],
	template: `
		<a router-link="base">base</a>
		<a router-link="dashboard">dashboard</a>
		<a router-link="login">login</a>
		<br>
		<router-outlet></router-outlet>
	`
})
@RouteConfig([
	{ path: '/', component: Base, as: 'base' },
	{ path: '/dashboard', component: Dashboard, as: 'dashboard' },
	{ path: '/login', component: Login, as: 'login' },
])
class App {
	userid: string;
	password: string;

	constructor() {

	}
}
bootstrap(App, [routerInjectables]);
開發者ID:pumpk1n,項目名稱:angular2-router-test,代碼行數:30,代碼來源:app.ts

示例7: constructor

/// <reference path="../typings/tsd.d.ts" />
import {Component, View, bootstrap} from 'angular2/angular2';

import {LastFMEvents}      from 'components/lastfm/events/component'
import {InstagramPictures} from 'components/instagram/pictures/component'
import {InstagramPicture}  from 'components/instagram/picture/component'

@Component({
  selector: 'app'
})
@View({
  templateUrl: 'app.html',
  directives: [LastFMEvents, InstagramPictures]
})
class App {

  public pictures: Array<InstagramPicture>

  constructor() {}

}

bootstrap(App);
開發者ID:yadomi,項目名稱:lastagram,代碼行數:23,代碼來源:app.ts

示例8: constructor

/* Contenedor principal */
@Component({
  selector: 'game',
  injectables: [PlayerComponent,TileService]
})
@View({
  template: `
  <h1>Multi-user Memory Game!!</h1>
  <div id="gameContainer">
    <div id="playerContainer1">
      <player>
      </player>
    </div>
    <div id="playerContainer2">
      <player>
      </player>
    </div>
  </div>
  `,
  directives: [PlayerComponent] 
})
export class GameComponent {
  player1: PlayerComponent;
  player2: PlayerComponent;
	constructor(player1:PlayerComponent,player2:PlayerComponent){
    this.player1 = player1;
    this.player2 = player2;
	}
}
bootstrap(GameComponent); 
開發者ID:mperezcol,項目名稱:angular2-lab,代碼行數:30,代碼來源:game.ts

示例9: constructor

    template: `
    <div class="row">
    <div class="col-md-12">
        <new-genre-form />
    </div>
    </div>
    <tabs>
        <tab *ng-for="#genre of genres" [tab-title]="genre.name + ' (' + genre.artistCount + ')'">
            <music-genre [genre]="genre"></music-genre>
        </tab>
    </tabs>
    `,
    directives: [TabsComponent, TabComponent, NgFor, MusicGenreComponent, NewGenreFormComponent]
})
class MusicBrowserComponent {
    genres:Array<MusicGenre>;

    constructor(musicGenreService: MusicGenreService) {
        this.genres = musicGenreService.genres;
    }

    activateGenre(genre: MusicGenre){
        this.genres.forEach(genre => genre.isActive = false);
        genre.isActive = true;
        return false;
    }
    
}

bootstrap(MusicBrowserComponent);
開發者ID:nicojs,項目名稱:angular2-music-browser,代碼行數:30,代碼來源:MusicBrowserComponent.ts

示例10: bootstrap

/// <reference path="typings/tsd.d.ts" />

import {bootstrap} from 'angular2/angular2';
import {Todo} from 'components/todo';

bootstrap(Todo);
開發者ID:trainerbill,項目名稱:generator-ng-fullstack,代碼行數:6,代碼來源:index.ts


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