having trouble getting my image to show.. Any idea what i am doing wrong?
<img style="width:175px" [src]="imageToShow">
getImage(){
this.mccProgramService.getImageFromService().subscribe(
(res) => {
console.log(res);
this.imageToShow = res;
// window.open(fileURL);
}
);
}
getImageFromService() {
return this._httpClient.get("http://localhost:9080/mccr/api/file/download.action?contentFileId=11", {observe: 'response', responseType: 'blob'})
.map((res) => {
return new Blob([res.body], {type: res.headers.get('Content-Type')});
})
}
Data is coming back as this from service
<<other headers>>
<<Content-Type header>>
<<other headers>>
<<file binary data>>