angular - 如何将js转换为内容浏览器的Ts?
问题描述
将 js 文件转换为 ts 文件,但仍然面临名为 content-exlporer undefined 的错误。如何在 angular2 中使用内容资源管理器。
In js files javascript code
var hostURL = window.location.origin,
baseURL = hostURL + window.location.pathname + "rest/";
var folderId, accessToken;
var contentExplorer = new Box.ContentExplorer();
var fileCollection = new Array();
在 ts 文件中打字稿代码
声明了以下参数的所有变量并将其添加到 ngOninit 中。
this.hostURL = window.location.origin;
this.baseURL = this.hostURL + window.location.pathname + "rest/";
const { ContentExplorer } = this.Box;
this. contentExplorer = new ContentExplorer();
解决方案
推荐阅读
- java - java.lang.NullPointerException: 来自 InputStreamReader 的 lock == null
- java - 即使没有错误,Webview 也不显示
- r - R dplyr 如何通过保留特定记录中的信息来汇总信息
- javascript - 无法选择任何 Redux 存储对象属性
- javascript - 如何将 JavaScript 函数添加到 Pug 模板
- json - 无法通过 perl DBI 从 MariaDB 获取返回值
- r - 用 ggplot 为许多变量按组绘制优势比
- spring-boot - 使用 onErrorResume 处理使用 Reactor Kafka 发布到 Kafka 的有问题的有效负载
- r - 删除 igraph 中的最大派系
- azure-virtual-network - 将现有 Azure 容器实例添加到 VNET