2016-03-26 12:18:13 -04:00
|
|
|
// #docregion
|
2016-04-27 14:28:22 -04:00
|
|
|
import { Component } from '@angular/core';
|
2016-03-26 12:18:13 -04:00
|
|
|
|
|
|
|
import { HeroBiosComponent,
|
|
|
|
HeroBiosAndContactsComponent} from './hero-bios.component';
|
|
|
|
import { HeroOfTheMonthComponent } from './hero-of-the-month.component';
|
|
|
|
import { HeroesBaseComponent,
|
|
|
|
SortedHeroesComponent } from './sorted-heroes.component';
|
|
|
|
import { HighlightDirective } from './highlight.directive';
|
|
|
|
import { ParentFinderComponent } from './parent-finder.component';
|
|
|
|
|
|
|
|
const DIRECTIVES = [
|
|
|
|
HeroBiosComponent, HeroBiosAndContactsComponent,
|
|
|
|
HeroesBaseComponent, SortedHeroesComponent,
|
2016-06-03 12:00:53 -04:00
|
|
|
HeroOfTheMonthComponent,
|
2016-03-26 12:18:13 -04:00
|
|
|
HighlightDirective,
|
|
|
|
ParentFinderComponent
|
|
|
|
];
|
|
|
|
|
|
|
|
// #docregion import-services
|
|
|
|
import { LoggerService } from './logger.service';
|
|
|
|
import { UserContextService } from './user-context.service';
|
|
|
|
import { UserService } from './user.service';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'my-app',
|
2016-05-16 21:56:13 -04:00
|
|
|
templateUrl: 'app/app.component.html',
|
2016-03-26 12:18:13 -04:00
|
|
|
directives: DIRECTIVES,
|
|
|
|
// #docregion providers
|
|
|
|
providers: [LoggerService, UserContextService, UserService]
|
|
|
|
// #enddocregion providers
|
|
|
|
})
|
|
|
|
export class AppComponent {
|
|
|
|
// #enddocregion import-services
|
|
|
|
|
2016-05-16 21:56:13 -04:00
|
|
|
private userId: number = 1;
|
2016-03-26 12:18:13 -04:00
|
|
|
|
|
|
|
// #docregion ctor
|
2016-05-16 21:56:13 -04:00
|
|
|
constructor(logger: LoggerService, public userContext: UserContextService) {
|
2016-03-26 12:18:13 -04:00
|
|
|
userContext.loadUser(this.userId);
|
|
|
|
logger.logInfo('AppComponent initialized');
|
|
|
|
}
|
|
|
|
// #enddocregion ctor
|
|
|
|
// #docregion import-services
|
|
|
|
}
|
|
|
|
// #enddocregion import-services
|