将js文件转换为ts文件,但仍然面临称为content- exlporer undefined。如何在angular2中使用Content Explorer。
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();