31 lines
740 B
TypeScript
Raw Normal View History

2015-12-23 09:42:57 -08:00
// #docplaster
// #docregion
2016-04-27 11:28:22 -07:00
import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
2015-12-23 09:42:57 -08:00
import { HeroService } from './hero.service';
2015-12-23 09:42:57 -08:00
@Component({
selector: 'my-app',
// #docregion template
2015-12-23 09:42:57 -08:00
template: `
<h1>{{title}}</h1>
<nav>
<a [routerLink]="['/dashboard']" routerLinkActive="active">Dashboard</a>
<a [routerLink]="['/heroes']" routerLinkActive="active">Heroes</a>
2015-12-23 09:42:57 -08:00
</nav>
<router-outlet></router-outlet>
`,
// #enddocregion template
// #docregion style-urls
2015-12-23 09:42:57 -08:00
styleUrls: ['app/app.component.css'],
// #enddocregion style-urls
2015-12-23 09:42:57 -08:00
directives: [ROUTER_DIRECTIVES],
providers: [
HeroService
]
})
export class AppComponent {
title = 'Tour of Heroes';
}