I am using angular material dialog box. currently its open. but i do not know how it close using dialog box close button. i tried several times, but could not do it. please check below code (part of code)
constructor(private summaryService: SummaryService,public dialog: MatDialog) { }
openDialog(): void {
const dialogRef = this.dialog.open(ConfirmationDialog, {
});
}
closeDialog(){
alert("test");
this.dialog.close();
}
openDialog() is working well. i have two problems in the colseDialog() function. when i alert some text, error " _co.closeDialog is not a function". other error display in my IDE "Property 'close' does not exist on type 'MatDialog'". can u give solution to close popup
this.dialogRef.close();and notthis.dialog.close();- ibenjelloun