作者:会展小控 | 来源:互联网 | 2022-12-31 19:13
有没有办法我可以打开角度材料2对话框与视图子参考,而无需创建对话框组件?
1> Diluk Angelo..:
试试这个
View.html
It works
component.ts
openModal(templateRef) {
let dialogRef = this.dialog.open(templateRef, {
width: '250px',
// data: { name: this.name, animal: this.animal }
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
// this.animal = result;
});
}