Trying to pass data from my dialog to the parent component, but ending up with an empty result. Here's my dialog template:
<mat-form-field class="example-full-width">
<input [(ngModel)]="data.animalData" matInput placeholder="Favorite food" value="Sushi">
</mat-form-field>
This is how my parent component ts looks like:
export interface DialogData {
aze:any;
}
openDialog(az:any) {
let dialogRef = this.dialog.open(MyDialogComponent, {
width: '100px',
data: {aze:this.az}
});
dialogRef.afterClosed().subscribe(result => {
this.azz = result;
})
}
Even though I want to pass data.animalData to the result, it seems to be empty.
Note that :
prints something in the dialog component.console.log(this.data.animalData);