Skip to content

Commit eb12317

Browse files
josephperrottmmalerba
authored andcommitted
chore(dialog): add comment for MatDialogContainer injection token (#8029)
1 parent dc1bf54 commit eb12317

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/dialog/dialog.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ export class MatDialog {
281281
const injectionTokens = new WeakMap();
282282

283283
injectionTokens.set(MatDialogRef, dialogRef);
284+
// The MatDialogContainer is injected in the portal as the MatDialogContainer and the dialog's
285+
// content are created out of the same ViewContainerRef and as such, are siblings for injector
286+
// purposes. To allow the hierarchy that is expected, the MatDialogContainer is explicitly
287+
// added to the injection tokens.
284288
injectionTokens.set(MatDialogContainer, dialogContainer);
285289
injectionTokens.set(MAT_DIALOG_DATA, config.data);
286290
injectionTokens.set(Directionality, {

0 commit comments

Comments
 (0)