Skip to content

Commit 2b1c733

Browse files
demo(dialog): set init values for minWidth, minHeight, maxWidth and maxHeight
1 parent 8e69f7b commit 2b1c733

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

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

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
11
import {Component, Inject, ViewChild, TemplateRef} from '@angular/core';
22
import {DOCUMENT} from '@angular/platform-browser';
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-
}
3+
import {MatDialog, MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
4+
5+
const defaultDialogConfig = new MatDialogConfig();
196

207
@Component({
218
moduleId: module.id,
@@ -28,13 +15,17 @@ export class DialogDemo {
2815
lastAfterClosedResult: string;
2916
lastBeforeCloseResult: string;
3017
actionsAlignment: string;
31-
config: MatDemoDialogConfig = {
18+
config = {
3219
disableClose: false,
3320
panelClass: 'custom-overlay-pane-class',
3421
hasBackdrop: true,
3522
backdropClass: '',
3623
width: '',
3724
height: '',
25+
minWidth: '',
26+
minHeight: '',
27+
maxWidth: defaultDialogConfig.maxWidth,
28+
maxHeight: '',
3829
position: {
3930
top: '',
4031
bottom: '',

0 commit comments

Comments
 (0)