Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular JSONP请求-角度2错误_Angular_Jsonp_Instagram Api - Fatal编程技术网

Angular JSONP请求-角度2错误

Angular JSONP请求-角度2错误,angular,jsonp,instagram-api,Angular,Jsonp,Instagram Api,我正试图使用Angular 2向instagram API发出jsonp请求,但我得到“jsonp注入脚本未调用回调” 我遵循了这一点,也遵循了angular 2的官方文档,但无法使其工作 fetch() { return this._jsonp.get('https://api.instagram.com/v1/users/self/?callback=JSONP_CALLBACK&access_token={token}') .map(res => res.json

我正试图使用Angular 2向instagram API发出jsonp请求,但我得到“jsonp注入脚本未调用回调”

我遵循了这一点,也遵循了angular 2的官方文档,但无法使其工作

fetch() {
  return this._jsonp.get('https://api.instagram.com/v1/users/self/?callback=JSONP_CALLBACK&access_token={token}')
    .map(res => res.json());
}
Jsonp被注入到构造函数中,并导入到服务和app.module.ts中。 我尝试了callback=JSONP\u回调、c=JSONP\u回调和JSONP=JSONP\u回调,但都不起作用


如果我是通过邮递员完成的,它就可以工作。

请检查您使用的@angular/http版本。http-2.4.7版本中存在错误。如果是这种情况,则将其降级为http-2.4.5.btw,相关问题请检查您使用的@angular/http版本。http-2.4.7版本中存在错误。如果是这种情况,则将其降级为http-2.4.5.btw,相关问题