Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ ./src/app/hero.service.ts 13:11-40
- @ ./src/app/app.module.ts
- @ ./src/main.ts
- @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
- my code for hero.service.ts
- import { Injectable } from '@angular/core';
- import { Observable } from 'rxjs';
- import { of } from 'rxjs/Observable/of';
- import { Hero } from './hero';
- import { HEROES } from './mock-heroes';
- import { MessageService } from './message.service';
- @Injectable()
- export class HeroService {
- constructor(private messageService: MessageService) { }
- getHeroes(): Observable<Hero[]>
- {
- // todo: send the message _after_fetching the heroes
- this.messageService.add('HeroService: fetched heroes');
- return of (HEROES);
- }
- }
Add Comment
Please, Sign In to add comment