Angular 2 error

I'm trying to make a jsonp request to the instagram API with Angular 2 but I'm getting "JSONP injected script did not invoke callback"

I followed this How to make a simple JSONP asynchronous request in Angular 2? and also the official doc of angular 2 but can't make it work.

fetch() {
  return this._jsonp.get('https://api.instagram.com/v1/users/self/?callback=JSONP_CALLBACK&access_token={token}')
    .map(res => res.json());
}

Jsonp is injected in the constructor and imported in the service, and in the app.module.ts as well. I tried callback=JSONP_CALLBACK, c=JSONP_CALLBACK and jsonp=JSONP_CALLBACK but none of them work.

If I make it via postman it works.

链接地址: http://www.djcxy.com/p/47562.html

上一篇: 离子3 http请求

下一篇: Angular 2错误