ABHILASHA K.M
ABHILASHA K.M

Reputation: 164

Pop Up in Angular and Getting Value from 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.

Can anyone help on this ?

Upvotes: 0

Views: 2470

Answers (1)

Shlok Nangia
Shlok Nangia

Reputation: 2377

in you dialog add

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

and you will get it here

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

enter image description here

Upvotes: 1

Related Questions