如何在Angular 2应用程序中使用自定义jsonp回调

时间:2016-12-09 09:19:29

标签: angular

我正在尝试将Jsonp.get配置为在Angular 2中使用自定义 JSONP_CALLBACK 方法。 当我做这样的事情时:

this.jsonp.get(`${url}?callback=content`)
  .map(this.checkForError)
  .catch(err => Observable.throw(err))
  .map(this.getJson);

我收到错误:

file.json?callback=content:1 Uncaught ReferenceError: content is not defined

由于

1 个答案:

答案 0 :(得分:0)

这是一个已知的限制,但已经有待处理的拉取请求

https://github.com/angular/angular/issues/13175