Skip to content

Commit 971ab53

Browse files
karajosephperrott
authored andcommitted
chore(ivy): add static flag to dialog-related static queries (#15239)
1 parent ba8d14b commit 971ab53

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/cdk-experimental/dialog/dialog-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class CdkDialogContainer extends BasePortalOutlet implements OnDestroy {
9797
// tslint:disable:no-host-decorator-in-concrete
9898

9999
/** The portal host inside of this container into which the dialog content will be loaded. */
100-
@ViewChild(PortalHostDirective) _portalHost: PortalHostDirective;
100+
@ViewChild(PortalHostDirective, {static: true}) _portalHost: PortalHostDirective;
101101

102102
/** A subject emitting before the dialog enters the view. */
103103
_beforeEnter: Subject<void> = new Subject();

src/lib/dialog/dialog-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function throwMatDialogContentAlreadyAttachedError() {
7272
})
7373
export class MatDialogContainer extends BasePortalOutlet {
7474
/** The portal outlet inside of this container into which the dialog content will be loaded. */
75-
@ViewChild(CdkPortalOutlet) _portalOutlet: CdkPortalOutlet;
75+
@ViewChild(CdkPortalOutlet, {static: true}) _portalOutlet: CdkPortalOutlet;
7676

7777
/** The class that traps and manages focus within the dialog. */
7878
private _focusTrap: FocusTrap;

src/lib/snack-bar/snack-bar-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class MatSnackBarContainer extends BasePortalOutlet implements OnDestroy
5555
private _destroyed = false;
5656

5757
/** The portal outlet inside of this container into which the snack bar content will be loaded. */
58-
@ViewChild(CdkPortalOutlet) _portalOutlet: CdkPortalOutlet;
58+
@ViewChild(CdkPortalOutlet, {static: true}) _portalOutlet: CdkPortalOutlet;
5959

6060
/** Subject for notifying that the snack bar has exited from view. */
6161
readonly _onExit: Subject<any> = new Subject();

0 commit comments

Comments
 (0)