If the parent is a service you can communicate via the service.
However you'll run into circular reference issues if they both reference each other. You can instead use the data
parameter when you open the dialog to pass the 'parent' to it (I like to do this via an interface).
So in the component when you inject MAT_DIALOG_DATA
you can specify it as a certain interface.
@Inject(MAT_DIALOG_DATA) public data: IMainMenuDialogData
Then define that for whatever you're passing in.
export interface IMainMenuDialogData
{
mainMenuService: MainMenuService;
}
In the 'parent' component you pass it in via the data
property
this.dialogRef.next(this.dialog.open(MainMenuDialogComponent, {
width: '100vw',
height: '100%',
data: <IMainMenuDialogData> { mainMenuService: this } ....
If you don't like passing in the whole service you can pass in specific observables, or properties or whatever else you need.