I need to pass data from angular material bottomsheet to its parent component.
Like we have [mat-dialog-close] directive in angular material dialog component where we can pass data from dialog to parent like as mentioned in
https://material.angular.io/components/dialog/api#MatDialogClose
dialog html:
<button [mat-dialog-close]="'dataWhichNeedsToBePassed'" cdkFocusInitial>Ok</button>
and recieve in parent component as:
dialogRef.afterClosed().subscribe(result => {
console.log(result); //dataWhichNeedsToBePassed
});
similarly, I need to pass data from bottomsheet to parent component(from where bottomsheet has been called).
Looks like there is no predefined directive present in https://material.angular.io/components/bottom-sheet/api
what could be the best solution here.