弹出Angular并从PopUP获得价值

On click Save Button, PopUp should open by let dialogRef = this.dialog.open(this.callAPIDialog); and I need <textarea matInput placeholder="Leave a comment" formControlName="description"></textarea> and submit Button in the pop up. And On clicking Submit, Value to be transferred same Function.

有人可以帮忙吗?

评论
明天H
明天H

在对话框中添加

(click)="dialogRef.close(value)"

你会在这里得到它

dialogRef.afterClosed().subscribe(result => {
  console.log(`Dialog result: ${result}`); // which will be value
})

please check this link for more https://material.angular.io/components/dialog/overview

点赞
评论