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
|
|
|
|
|
|
|
// #docregion import-services
|
|
|
|
import { LoggerService } from './logger.service';
|
|
|
|
import { UserContextService } from './user-context.service';
|
|
|
|
import { UserService } from './user.service';
|
|
|
|
|
|
|
|
@Component({
|
2016-09-25 21:51:54 -04:00
|
|
|
moduleId: module.id,
|
2016-03-26 12:18:13 -04:00
|
|
|
selector: 'my-app',
|
2016-09-25 21:51:54 -04:00
|
|
|
templateUrl: 'app.component.html',
|
2016-03-26 12:18:13 -04:00
|
|
|
// #docregion providers
|
2016-09-25 21:51:54 -04:00
|
|
|
providers: [ LoggerService, UserContextService, UserService ]
|
2016-03-26 12:18:13 -04:00
|
|
|
// #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
|