【问题标题】:Image not displaying from server ionic 4图像未从服务器 ionic 4 显示
【发布时间】:2019-12-12 17:27:08
【问题描述】:

我已将图像存储到服务器端的文件夹和数据库中。 我可以从 api 调用中取回图像,但是它不会显示在我的 html 中。我只得到?盒子。

查看图片

viewImage() {
individuals = [];


    this.viewService.viewImage(this.id).subscribe((res: any) => {
      console.log(res);
      this.pImages = res.patients.data;
      // console.log(res.patients.data);
      console.log('IMAGES');
      console.log(JSON.stringify(this.pImages));
    });
  }

html

<ion-col *ngFor='let img of pImages'>


<img [src] = "'http://ccoulter12.lampt.eeecs.qub.ac.uk/api/'"img.Image />

【问题讨论】:

    标签: angular image ionic-framework


    【解决方案1】:

    你可以这样使用

    <ion-col *ngFor="let img of pImages">
    <img src="http://ccoulter12.lampt.eeecs.qub.ac.uk/api/{{img.Image}}"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-29
      • 1970-01-01
      • 1970-01-01
      • 2020-11-23
      • 2018-05-24
      • 1970-01-01
      • 2015-11-17
      • 2011-07-15
      相关资源
      最近更新 更多