From 0cc61ae0fe3ae40e7777e322e7d2913ed7a54510 Mon Sep 17 00:00:00 2001 From: Emilio Martinez-Cordero Date: Tue, 3 Oct 2017 00:49:16 -0700 Subject: [PATCH] demo(dialog): add fields for minWidth, minHeight, maxWidth and maxHeight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not adding `minWidth`, `minHeight`, `maxWidth` and `maxHeight` to `config` to avoid overriding the default value of `maxWidth` particularly—the type checker will require it to be a string. Instead, setting `config` to type `MatDialogConfig` is prefered to appease the type checker since those four properties are optional. --- src/demo-app/dialog/dialog-demo.html | 18 ++++++++++++++++++ src/demo-app/dialog/dialog-demo.ts | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/demo-app/dialog/dialog-demo.html b/src/demo-app/dialog/dialog-demo.html index ffceaaae13bf..b54508cf30b0 100644 --- a/src/demo-app/dialog/dialog-demo.html +++ b/src/demo-app/dialog/dialog-demo.html @@ -23,6 +23,24 @@

Dialog dimensions

+

+ + + + + + +

+ +

+ + + + + + +

+

Dialog position

diff --git a/src/demo-app/dialog/dialog-demo.ts b/src/demo-app/dialog/dialog-demo.ts index 87c67b151e18..05f29786bda2 100644 --- a/src/demo-app/dialog/dialog-demo.ts +++ b/src/demo-app/dialog/dialog-demo.ts @@ -1,6 +1,6 @@ import {Component, Inject, ViewChild, TemplateRef} from '@angular/core'; import {DOCUMENT} from '@angular/platform-browser'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material'; +import {MatDialog, MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material'; @Component({ @@ -14,7 +14,7 @@ export class DialogDemo { lastAfterClosedResult: string; lastBeforeCloseResult: string; actionsAlignment: string; - config = { + config: Partial = { disableClose: false, panelClass: 'custom-overlay-pane-class', hasBackdrop: true,