From 15313f94ae75b6464054ada0bbad353eb1c9a0f8 Mon Sep 17 00:00:00 2001 From: Ales Rechtorik Date: Sat, 28 Jan 2017 20:01:21 +0100 Subject: [PATCH] add ability to open dialog with portal --- src/demo-app/dialog/dialog-demo.html | 8 ++++ src/demo-app/dialog/dialog-demo.ts | 11 ++++- src/lib/dialog/dialog-container.ts | 32 +++++++++----- src/lib/dialog/dialog-element.html | 3 ++ src/lib/dialog/dialog-element.ts | 62 +++++++++++++++++++++++++++ src/lib/dialog/dialog-ref.ts | 6 ++- src/lib/dialog/dialog.ts | 63 ++++++++++++++++++++++++---- src/lib/dialog/index.ts | 7 +++- 8 files changed, 172 insertions(+), 20 deletions(-) create mode 100644 src/lib/dialog/dialog-element.html create mode 100644 src/lib/dialog/dialog-element.ts diff --git a/src/demo-app/dialog/dialog-demo.html b/src/demo-app/dialog/dialog-demo.html index 53734bbbfdff..66d31238cc20 100644 --- a/src/demo-app/dialog/dialog-demo.html +++ b/src/demo-app/dialog/dialog-demo.html @@ -51,3 +51,11 @@

Other options

Last close result: {{lastCloseResult}}

+ + + + + + whatup + + diff --git a/src/demo-app/dialog/dialog-demo.ts b/src/demo-app/dialog/dialog-demo.ts index 5e91c097f9aa..18b0b19b2da1 100644 --- a/src/demo-app/dialog/dialog-demo.ts +++ b/src/demo-app/dialog/dialog-demo.ts @@ -10,6 +10,7 @@ import {MdDialog, MdDialogRef, MdDialogConfig} from '@angular/material'; }) export class DialogDemo { dialogRef: MdDialogRef; + elementDialogState: boolean = false; lastCloseResult: string; actionsAlignment: string; config: MdDialogConfig = { @@ -51,6 +52,14 @@ export class DialogDemo { let dialogRef = this.dialog.open(ContentElementDialog, this.config); dialogRef.componentInstance.actionsAlignment = this.actionsAlignment; } + + openElementDialog() { + this.elementDialogState = true; + } + + closeElementDialog() { + this.elementDialogState = false; + } } @@ -104,7 +113,7 @@ export class JazzDialog { color="primary" href="https://en.wikipedia.org/wiki/Neptune" target="_blank">Read more on Wikipedia - +