I have component A which fires MatDialog
openDialog(): void {
// console.log('The dialog was opened');
const dialogRef = this.dialog.open(PicuploadComponent, {
width: '1000px',
//data: {name: this.name, animal: this.animal}
});
dialogRef.afterClosed().subscribe(result => {
// I want to get data from upload response here! **res**
});
}
This component fires PicuploadComponent where I upload image and receive response with some data
onUpload() {
const fd = new FormData();
fd.append('image', this.selectedFile);
this.service.uploadImage(fd).subscribe(
(res:any)=>
{
console.log(res) ;
this.dialogRef.close();
},
);
}