Permalink
Find file Copy path
17961df Sep 19, 2016
0 contributors

Users who have contributed to this file

18 lines (14 sloc) 392 Bytes
import {Http, Response} from '@angular/http';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map'; // add map function to observable
@Injectable()
export class PizzaService {
constructor(
private http: Http
) { }
getPizza() {
return this.http.get('pizza.json')
.map((res: Response) => res.json());
}
}