Skip to content

Commit

Permalink
demo(dialog): address AOT issues
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
emilio-martinez committed Oct 3, 2017
1 parent 0cc61ae commit 9aa50df
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/demo-app/dialog/dialog-demo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import {Component, Inject, ViewChild, TemplateRef} from '@angular/core';
import {DOCUMENT} from '@angular/platform-browser';
import {MatDialog, MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';

import {
DialogPosition,
MatDialog,
MatDialogConfig,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';

/**
* 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.
*/
interface MatDemoDialogConfig extends MatDialogConfig {
position: DialogPosition;
}

@Component({
moduleId: module.id,
Expand All @@ -14,7 +28,7 @@ export class DialogDemo {
lastAfterClosedResult: string;
lastBeforeCloseResult: string;
actionsAlignment: string;
config: Partial<MatDialogConfig> = {
config: MatDemoDialogConfig = {
disableClose: false,
panelClass: 'custom-overlay-pane-class',
hasBackdrop: true,
Expand Down

0 comments on commit 9aa50df

Please sign in to comment.