Angular4 show image from server

Viewed 22581

I want to show an image in img tag : i am doing it that way

Component

this.file.url=this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(this.file.url));

Template

<img [src]="file.url">

I am getting this error

ERROR TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.
2 Answers
Related