Skip to content

Commit 401e686

Browse files
demo(dialog): address demo AOT issues
Appeases the AOT type checker for the template by extending `MatDialogConfig` to disallow `position` from being undefined, given that it’s optional. Guards cannot be set on the template because the values are bound to NgModel.
1 parent 0cc61ae commit 401e686

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/demo-app/dialog/dialog-demo.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
import {Component, Inject, ViewChild, TemplateRef} from '@angular/core';
22
import {DOCUMENT} from '@angular/platform-browser';
3-
import {MatDialog, MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
4-
3+
import {
4+
DialogPosition,
5+
MatDialog,
6+
MatDialogConfig,
7+
MatDialogRef,
8+
MAT_DIALOG_DATA
9+
} from '@angular/material';
10+
11+
/**
12+
* Appeases the AOT type checker for the template by extending `MatDialogConfig`
13+
* to disallow `position` from being undefined, given that it’s optional.
14+
* Guards cannot be set on the template because the values are bound to NgModel.
15+
*/
16+
interface MatDemoDialogConfig extends MatDialogConfig {
17+
position: DialogPosition;
18+
}
519

620
@Component({
721
moduleId: module.id,
@@ -14,7 +28,7 @@ export class DialogDemo {
1428
lastAfterClosedResult: string;
1529
lastBeforeCloseResult: string;
1630
actionsAlignment: string;
17-
config: Partial<MatDialogConfig> = {
31+
config: MatDemoDialogConfig = {
1832
disableClose: false,
1933
panelClass: 'custom-overlay-pane-class',
2034
hasBackdrop: true,

0 commit comments

Comments
 (0)