我需要刷新这样加载的图像:
<img [src]="linkPicture" alt="profile photo" width="150px" height="150px">Run Code Online (Sandbox Code Playgroud)
到打字稿文件中,我有一个变量this.linkPicture,我最初存储了链接。当我更新图片时,请不要刷新。我再次设置了变量。
这是我的打字稿代码的一部分
public linkPicture : string;
Run Code Online (Sandbox Code Playgroud)
初始设置变量
this.service.GetProfile(id).subscribe(resp => {
.....
this.linkPicture = resp.Photo;
console.log(resp); //this show the photo
});
Run Code Online (Sandbox Code Playgroud)
当我更新图片时
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.
}
});
Run Code Online (Sandbox Code Playgroud) 有什么方法可以设置一个可扩展的角垫面板始终扩展?。当用户点击面板标题时,我不想关闭它
谢谢...