2015-12-10 09:40:54 -08:00
|
|
|
// #docplaster
|
|
|
|
// #docregion
|
2016-06-09 13:00:26 -05:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
import { ROUTER_DIRECTIVES } from '@angular/router';
|
2015-12-10 09:40:54 -08:00
|
|
|
|
2016-06-09 13:00:26 -05:00
|
|
|
import { DialogService } from './dialog.service';
|
|
|
|
import { HeroService } from './heroes/hero.service';
|
2015-12-31 16:55:53 -08:00
|
|
|
|
2015-12-10 09:40:54 -08:00
|
|
|
@Component({
|
|
|
|
selector: 'my-app',
|
2016-06-09 13:00:26 -05:00
|
|
|
// #docregion template
|
2015-12-10 09:40:54 -08:00
|
|
|
template: `
|
|
|
|
<h1 class="title">Component Router</h1>
|
2015-12-31 16:55:53 -08:00
|
|
|
<nav>
|
2016-05-02 16:53:25 -07:00
|
|
|
<a [routerLink]="['/crisis-center']">Crisis Center</a>
|
|
|
|
<a [routerLink]="['/heroes']">Heroes</a>
|
2016-06-09 13:00:26 -05:00
|
|
|
<a [routerLink]="['/crisis-center/admin']">Crisis Admin</a>
|
|
|
|
<a [routerLink]="['/login']">Login</a>
|
2015-12-31 16:55:53 -08:00
|
|
|
</nav>
|
2015-12-10 09:40:54 -08:00
|
|
|
<router-outlet></router-outlet>
|
|
|
|
`,
|
2016-06-09 13:00:26 -05:00
|
|
|
// #enddocregion template
|
|
|
|
providers: [
|
|
|
|
HeroService,
|
|
|
|
DialogService
|
|
|
|
],
|
2015-12-10 09:40:54 -08:00
|
|
|
directives: [ROUTER_DIRECTIVES]
|
|
|
|
})
|
2016-06-09 13:00:26 -05:00
|
|
|
export class AppComponent {
|
2016-05-02 16:53:25 -07:00
|
|
|
}
|