I need to refresh an image that I load like this:
<img [src]="linkPicture" alt="profile photo" width="150px" height="150px">
Into the typescript file I have a variable this.linkPicture that I store initially the link. When I update the picture don't refresh. I set the variable again....
Here is part of my typescript code
public linkPicture : string;
Set the variable initially
this.service.GetProfile(id).subscribe(resp => {
.....
this.linkPicture = resp.Photo;
console.log(resp); //this show the photo
});
When I update the picture
let dialogRef = this.dialog.open(DialogUploadPhotoComponent, {
data: {
patientID: this.ss.getCurrentUserApi().PatientID
},
width : "550px",
});
dialogRef.afterClosed().subscribe(result => {
if(result != undefined){
console.log(result);
this.linkPicture = result; //I set the new picture.
}
});