<ion-img> is truncating the src

Viewed 929

I have a simple ion-img element:

<ion-img *ngIf="images.length" [width]="w" [height]="h" [src]="thumb"></ion-img>

Problem: Image doesn't show, even if I place hard-coded URL

<ion-img *ngIf="images.length"  [width]="w" [height]="h" src="http://img.mako.co.il/2017/04/05/141414_x5.jpg"></ion-img>

Inspecting the element shows that the src has a truncated string of the thumb URL ( 31 characters exactly for each entire array )

just FYI, if I console.log("thumb:", thumb) -> show a valid thumb URL ...

I was able to pin-point the issue, and if I remove the *ngIf="images.length" - the image is shown .... but the above was just for the example ( this is how I caught this case ) - the real code is that - I'm waiting for an Array to be filled from an Http request ...

Plunker: http://plnkr.co/edit/433y7EIjWBsEzbPkCi7H?p=preview, the code is in home.ts & home.html, click the button called Set True - an and you'll see a small gray square next to it, remove the *ngIf="ionimg" - you'll see the img just fine ....

How can I solve it ?

1 Answers
Related