【问题标题】:Filestack error file Cannot find name 'FilestackTransform'.ts(2304) in angular 8Filestack错误文件在角度8中找不到名称'FilestackTransform'.ts(2304)
【发布时间】:2020-06-24 03:38:16
【问题描述】:

please see this image 1image 2 无法创建我的 Angular 8 项目的构建抛出找不到名称 FilestackTransform

onUploadSuccess(res: object) {
console.log('###uploadSuccess', res);
this.tempData = res;
this.tempUrl = this.tempData.filesUploaded[0].url;
const client = filestack.init(this.apikey); // initialize Filestack Client with your API key
const tr = new FilestackTransform(); // initialize Transformations UI
tr.setConfigKey('output.blob', true); // set Transformations UI to return blob
tr.open(this.tempUrl).then(res => {
  client.upload(res).then((uploadRes) => { // upload result of the transformation
    this.tempTranssformUrl = JSON.stringify(uploadRes.url, null, 2).split('"');
    (<HTMLImageElement>document.querySelector("#result")).src = this.tempTranssformUrl[1];
    this.isPicker = false;
  })
});

}

【问题讨论】:

  • 你是如何使用文件堆栈的?你安装了它的角度库吗?还是cdn还是什么?
  • 我已经安装了filestack SDK并在header中添加了transform js库

标签: angular filestack


【解决方案1】:

在一个类中,TypeScript 不允许用 变量 让 常量

声明 FilestackTransform:any; const tr = this.FilestackTransform();

【讨论】:

    猜你喜欢
    • 2019-07-13
    • 1970-01-01
    • 2018-01-04
    • 2019-12-25
    • 1970-01-01
    • 2019-08-14
    • 2020-12-15
    • 2021-01-27
    • 1970-01-01
    相关资源
    最近更新 更多