angular5 - 'Uncaught SyntaxError: Unexpected token %' 将 jsonp 与 angular5 一起使用时的问题
问题描述
我是 angular5 的新手,我尝试使用 'jsonp' 属性调用 api。
this.http.jsonp('http://localhost/angular5/lesson2.pdf?callback=JSONP_CALLBACK').subscribe(res=>{
console.log(res);
})
在上面的代码中,我使用'HttpClinetJsonpModule'来调用api。但它返回以下错误。 谁能帮我解决这个问题。我已经花了几个小时。
解决方案
推荐阅读
- hive - 从现有 Hive 表列创建多个列
- javascript - 根据相同的值对数组进行分组
- typescript - 错误 TS2688:找不到“dist”的类型定义文件
- python - 如何使用 Pandas 将字典导出到 Excel
- excel - 为什么我的 Excel 链接到同一文档中的工作表取决于语言?
- reactjs - JSX 编译需要什么加载器?
- multithreading - 如果将两个集成流传递给一个通用 MessageHandler 类,它是线程安全的吗?在 Spring 集成 DSL 中
- reactjs - 如何使用 React JS 进行身份验证
- php - 没有公共列的MySql连接表
- r - 排列 r 中的所有列