angular-docs-cn/public/docs/_examples/toh-5/ts/app/app.component.1.ts

32 lines
635 B
TypeScript
Raw Normal View History

2015-12-23 12:42:57 -05:00
// #docplaster
// #docregion
2016-04-27 14:28:22 -04:00
import { Component } from '@angular/core';
2015-12-23 12:42:57 -05:00
import { HeroService } from './hero.service';
import { HeroesComponent } from './heroes.component';
// #enddocregion
// For testing only
2016-04-27 14:28:22 -04:00
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated';
2015-12-23 12:42:57 -05:00
// #docregion
@Component({
selector: 'my-app',
template: `
<h1>{{title}}</h1>
<my-heroes></my-heroes>
`,
directives: [HeroesComponent],
providers: [
// #enddocregion
ROUTER_PROVIDERS,
// #docregion
HeroService
]
})
export class AppComponent {
title = 'Tour of Heroes';
}
// #enddocregion