角2 http得不到
import { Headers, Http, Response } from '@angular/http'; import { Injectable } from '@angular/core'; import { Persons } from './mock-people'; import { Person } from './person'; import {Observable} from 'rxjs/Rx'; getAllPersons(): void { console.log("Here"); this.http.get(`http://swapi.co/api/people/1`) .map((response: Response) => { console.log(response.json()); response.json(); }); console.log("Comes here 2"); }
HttpModule
相关分类