When trying to show images from server : Template
<img [src]="file.url">
Component (1) when i try this
this.file.url="http://localhost:4000/uploads/results/101_5.png";
It works fine (2) But when doing,
this.file.url=this.fromServer.url; // URl from server
Doesn't work and Angular add a it's host and i get this error :
101_5.png:1 GET http://localhost:4000/uploads/results/101_5.png 404 (Not Found)
(3) even this way :
this.file.url= "http://"+this.sanitizer.bypassSecurityTrustResourceUrl(this.fromServer.url);
getting this error
src="http://SafeValue must use [property]=binding: http://localhost:400 .... (see http://g.co/ng/security#xss)