李同学va 2022-08-23 08:42
浏览 12
已结题

Angular+marvinjs 火狐浏览器中出现兼容性问题

img

img

angular 代码:


  async createImage(e) {
    console.log(this.smilesDiv.nativeElement);
    console.log(this.smartsDiv.nativeElement);
    await e.marvinSketcherInstance.importStructure(null, this.rule_expr_str).catch(function (error) {
      console.log(error);
    });
    let mrv = await e.marvinSketcherInstance.exportStructure('mrv');
    const fragment = this.neutral;
    mrv = await this.formatImg(mrv, this.arrowtype, fragment, true);
    const image$ = e.createImage('image/jpeg', 700, 200);
    image$
      .render(mrv)
      .then((res) => {
        this.smilesDiv.nativeElement.src = res;
        this.cdf.detectChanges();
      })
      .catch((res) => {
        this.cdf.detectChanges();
      });

    await e.marvinSketcherInstance.importStructure(null, this.rule_expr).catch(function (error) {
      console.log(error);
    });
    let mrv1 = await e.marvinSketcherInstance.exportStructure('mrv');
    const fragment1 = this.neutral;
    mrv1 = await this.formatImg(mrv1, this.arrowtype, fragment1, true, 'aromatize');
    const image1$ = e.createImage('image/jpeg', 700, 200);
    image1$
      .render(mrv1)
      .then((res) => {
        this.smartsDiv.nativeElement.src = res;
        this.cdf.detectChanges();
      })
      .catch((res) => {
        this.cdf.detectChanges();
      });
  }

展开全部

  • 写回答

0条回答 默认 最新

    编辑
    预览

    报告相同问题?

    问题事件

    • 系统已结题 8月30日
    • 修改了问题 8月23日
    • 创建了问题 8月23日