I'm currently implementing image upload in my Angular project. I'm using Firebase Storage to store these images.
In my HTML file I check if the image is available and if it is, display it:
<img *ngIf="avatar" [src]="avatar" #avatar>
Avatar is set when I have uploaded the image. When an avatar is uploaded I am trying to display it to my template as a preview. Then I get this error:
GET http://localhost:4200/[object%20HTMLImageElement]
The avatar variable is just a string to the URL: https://firebasestorage.googleapis.com/v0/b/openix-crm.appspot.com/o/contact_images%2F2014-07-24%2021.23.45.jpg?alt=media&token=90018c6d-3316-4db4-911b-dd7d204c84aa
I've tried this, without much luck:
<img *ngIf="avatar" [attr.src]="avatar" #avatar>
<img *ngIf="avatar" [src]="avatar | async" #avatar>