2016-04-09 00:18:37 -04:00
|
|
|
// #docplaster
|
|
|
|
// #docregion
|
2016-06-26 13:13:44 -04:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
import { ROUTER_DIRECTIVES } from '@angular/router';
|
2016-04-09 00:18:37 -04:00
|
|
|
|
2016-06-26 13:13:44 -04:00
|
|
|
import { HeroService } from './hero.service';
|
2016-05-23 22:24:15 -04:00
|
|
|
// #docregion rxjs-extensions
|
|
|
|
import './rxjs-extensions';
|
|
|
|
// #enddocregion rxjs-extensions
|
2016-04-09 00:18:37 -04:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'my-app',
|
|
|
|
|
|
|
|
template: `
|
|
|
|
<h1>{{title}}</h1>
|
|
|
|
<nav>
|
2016-06-26 13:13:44 -04:00
|
|
|
<a [routerLink]="['/dashboard']" routerLinkActive="active">Dashboard</a>
|
|
|
|
<a [routerLink]="['/heroes']" routerLinkActive="active">Heroes</a>
|
2016-04-09 00:18:37 -04:00
|
|
|
</nav>
|
|
|
|
<router-outlet></router-outlet>
|
|
|
|
`,
|
|
|
|
styleUrls: ['app/app.component.css'],
|
|
|
|
directives: [ROUTER_DIRECTIVES],
|
|
|
|
providers: [
|
|
|
|
HeroService,
|
|
|
|
]
|
|
|
|
})
|
|
|
|
export class AppComponent {
|
|
|
|
title = 'Tour of Heroes';
|
|
|
|
}
|