X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fhero.service.ts;h=d0801f302c28fedf0cd9c61e92addb21569b27ef;hb=cdbcd5578c991169816c9b621c5a571ffdaefeb8;hp=7e0771a50dad343ed98dbbc01cb0ab1a2592a058;hpb=ef15a90ba71bcff7765f089af11e2ad22752a352;p=examples%2Fangular-tour-of-heroes diff --git a/src/app/hero.service.ts b/src/app/hero.service.ts index 7e0771a..d0801f3 100644 --- a/src/app/hero.service.ts +++ b/src/app/hero.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; +import { Observable, of } from 'rxjs'; import { Hero } from './hero'; import { HEROES } from './mock-heroes'; +import { MessageService } from './message.service'; @Injectable({ @@ -8,9 +10,9 @@ import { HEROES } from './mock-heroes'; }) export class HeroService { - constructor() { } + constructor(private messageService : MessageService) { } - getHeroes() : Hero[] { - return HEROES; + getHeroes() : Observable { + return of(HEROES); } }