import {Component} from '@angular/core'; import {Http, Response} from '@angular/http'; import 'rxjs/add/operator/map'; @Component({ selector: 'http-app', template: `

people

` }) export class HttpCmp { people: Object[]; constructor(http: Http) { http.get('./people.json') .map((res: Response) => res.json()) .subscribe((people: Array) => this.people = people); } }