I checked this link but I could not solve my problem.
I have a table on my page. When I double click each row, an Angular Materia Dialog is shown and the corresponding row data are loaded to that dialog. The followings are variable in the main ts
file:
eqId: string = '';
onDoubleClick(e: any): void {
this.eqId = e.rowData["EquipmentId"];
this.openDialog();
}
openDialog() {
const dialogRef = this.dialog.open(EquipmentDetailComponent);
dialogRef.afterClosed().subscribe(result => {
console.log(`Dialog result: ${result}`);
});
}
The EquipmentDetailComponent
's ts
file is:
@Input() eqId: string = '';
But when I run, eqId
is empty in the dialog.
How can I pass data to Angular Material Dialog?