c-mac
c-mac

Reputation: 83

Image not displaying from server ionic 4

I have stored images to a folder serverside and to my database. image response I can get the image back in from the api call however It wont display in my html. Im only getting the ? box.

viewImage

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 />

Upvotes: 0

Views: 786

Answers (1)

Aashish Chakravarty
Aashish Chakravarty

Reputation: 393

You can use like this

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

Upvotes: 1

Related Questions