나는 Angular 2에 익숙하지 않다. 나는 get call로 url을 치려고 노력하고 있지만 do not는 브라우저의 네트워크에서조차도 통과하지 못하는 것으로 보인다. 이 프로그램은 app.module.ts에서 전화를받을Angular 2 http get not get
내 서비스 방법
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을 요구하지 아무것도 얻을 위, 그 아래에 그 방법 콘솔 로깅 것입니다
내 콘솔 스크린 샷
감사합니다.하지만 우리가 donot 호출 여기에 가입하지만 호출하는 메서드를 호출하는 이유는 다음 작동합니다 –
둥지 부분은 콘솔 또는 어디서나 오류가 아니었다 :) –
감사합니다 그것은 거의 3-4 inorder 이 atlast 게시했다, 나를 도와 일부 오류가 있어야합니다 :) –