首页 > 解决方案 > 在 Angular 4 打字稿上加载外部网络库

问题描述

我正在尝试加载我的 spotfire javascript API 库:

我不能在我的 index.html 中这样做,因为这个 url 必须保存到我的 environment.ts 文件中。

我尝试使用以下代码调用此 api:

System.import('https://spotfire-next.cloud.tibco.com/spotfire/wp/GetJavaScriptApi.ashx?Version=7.5').then(file => {
   // perform additional interactions after the resource has been asynchronously fetched
});

但是有一个错误“无法加载模块”。

你能帮助我吗 ?

谢谢

标签: javascriptangulartypescript

解决方案


推荐阅读