projects
/
examples
/
angular-tour-of-heroes
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d51b3a
)
4: Add Services
author
Kai Moritz
<kai@juplo.de>
Sat, 2 May 2020 19:35:54 +0000
(21:35 +0200)
committer
Kai Moritz
<kai@juplo.de>
Sat, 2 May 2020 19:35:54 +0000
(21:35 +0200)
e) Show messages - Inject it into the HeroService
src/app/hero.service.ts
patch
|
blob
|
history
diff --git
a/src/app/hero.service.ts
b/src/app/hero.service.ts
index
a59d76b
..
d0801f3
100644
(file)
--- a/
src/app/hero.service.ts
+++ b/
src/app/hero.service.ts
@@
-2,6
+2,7
@@
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({
@@
-9,7
+10,7
@@
import { HEROES } from './mock-heroes';
})
export class HeroService {
- constructor() { }
+ constructor(
private messageService : MessageService
) { }
getHeroes() : Observable<Hero[]> {
return of(HEROES);