I am having a two dialogs with a sort of parent-child relationship. Parent is a standalone dialog component while child is created from ng-template
Now, the problem is, that if I use matDialogClose inside ng-template parent dialog is closed, and child is intact.
Here is a stackblitz for you https://stackblitz.com/edit/mat-dialog-example-vbxhc3
Main dialog template
<ng-template #nested>
hey, i am nested dialog, close me with the button
<button matDialogClose="someResult">CLOSE ME </button>
</ng-template>
opening child template
@ViewChild("nested")
nestedTmplateRef;
private dialog:MatDialog
...
this.dialog.open(this.nestedTmplateRef);
Can I close child dialog using matCloseDialog directive?? I am interested in using this solution as other obvious workarounds like controlling child dialog from component is know to me. However, using just directive would save me some boilerplace code. I am little bit rusty with angular material components and probably I dont see a obvious solution.