Guest User

Untitled

a guest
Jan 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. @ ./src/app/hero.service.ts 13:11-40
  2. @ ./src/app/app.module.ts
  3. @ ./src/main.ts
  4. @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
  5.  
  6. my code for hero.service.ts
  7.  
  8.  
  9. import { Injectable } from '@angular/core';
  10. import { Observable } from 'rxjs';
  11. import { of } from 'rxjs/Observable/of';
  12. import { Hero } from './hero';
  13. import { HEROES } from './mock-heroes';
  14. import { MessageService } from './message.service';
  15.  
  16. @Injectable()
  17. export class HeroService {
  18.  
  19. constructor(private messageService: MessageService) { }
  20.  
  21. getHeroes(): Observable<Hero[]>
  22.  
  23. {
  24. // todo: send the message _after_fetching the heroes
  25. this.messageService.add('HeroService: fetched heroes');
  26. return of (HEROES);
  27. }
  28. }
Add Comment
Please, Sign In to add comment