John Papa 39c5a2b949 Rc5 doc sweep (#2218)
* Removed 03-05, 04-12, 04-15.

Removed style for whitespace in imports.

Removed + sign prefix for routing folders. Updated all code.

Removed style that said to use lazy loading.  There was no value in the style other than use it :)

* renamed componet router to router
2016-09-13 18:51:03 -07:00

23 lines
653 B
TypeScript

import { Component, OnInit } from '@angular/core';
import { Hero, HeroService } from './heroes';
import { ExceptionService, SpinnerService, ToastService } from './shared';
@Component({
moduleId: module.id,
selector: 'sg-app',
templateUrl: 'app.component.html',
providers: [HeroService, ExceptionService, SpinnerService, ToastService]
})
export class AppComponent implements OnInit {
favorite: Hero;
heroes: Hero[];
constructor(private heroService: HeroService) { }
ngOnInit() {
this.heroService.getHero(1).subscribe(hero => this.favorite = hero);
this.heroService.getHeroes().subscribe(heroes => this.heroes = heroes);
}
}