在 Angular 中弹出并从 PopUP 中获取价值
Pop Up in Angular and Getting Value from PopUP
单击“保存”按钮后,弹出窗口应按 let dialogRef = this.dialog.open(this.callAPIDialog);
打开,我需要 <textarea matInput placeholder="Leave a comment" formControlName="description"></textarea>
并在弹出窗口中提交按钮。并且在单击提交时,要传输相同功能的值。
任何人都可以帮忙吗?
在你的对话框中添加
(click)="dialogRef.close(value)"
你会在这里得到它
dialogRef.afterClosed().subscribe(result => {
console.log(`Dialog result: ${result}`); // which will be value
})
请检查此 link 了解更多 https://material.angular.io/components/dialog/overview
单击“保存”按钮后,弹出窗口应按 let dialogRef = this.dialog.open(this.callAPIDialog);
打开,我需要 <textarea matInput placeholder="Leave a comment" formControlName="description"></textarea>
并在弹出窗口中提交按钮。并且在单击提交时,要传输相同功能的值。
任何人都可以帮忙吗?
在你的对话框中添加
(click)="dialogRef.close(value)"
你会在这里得到它
dialogRef.afterClosed().subscribe(result => {
console.log(`Dialog result: ${result}`); // which will be value
})
请检查此 link 了解更多 https://material.angular.io/components/dialog/overview