Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dialog): add md-dialog component #2855

Closed
wants to merge 7 commits into from
Closed

Conversation

fxck
Copy link
Contributor

@fxck fxck commented Jan 29, 2017

Needs #2853.

md-dialog is a stateless component that's gonna be handy for people that use global state management like redux or @ngrx/store. It's also nice when you want to use standard input/output to pass data to the component inside your dialog(#2552, #2086, #2181 related).

<md-dialog [open]="loginDialogState">
  <login-form [data]="loginDefaultData" (submit)="loginSubmitted($event)"></login-form>
</md-dialog>

Internally it uses openFromTemplateRef() which is added by #2853, it disables closing by backdrop click and escape key by default(to be truly stateless), instead emits close event with event data containing what caused it(escape, backdrop).

It's got similar api to that of https://developer.mozilla.org/en/docs/Web/HTML/Element/dialog

  • [open] controls whether dialog is shown or not
  • (close) emits event when either backdrop was clicked or escape was pressed
  • [config] allows passing in MdDialogConfig

@jelbourn @crisbeto

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 29, 2017
</button>
</div>

<md-dialog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a full review for now, but I would do this as a directive that is meant to go on a template element, so it would be either of

<template mdDialog ...>

or

<div *mdDialog ...>

Mainly so that it doesn't leave a phantom md-dialog element in the DOM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jelbourn I think that would make using inputs/outputs impossible, wouldn't it?

@ethanve
Copy link

ethanve commented Apr 13, 2017

Any news on this? Can I help in any way?

@fxck
Copy link
Contributor Author

fxck commented Apr 13, 2017

@ethanve it's blocked on #3460 go bug @jelbourn to do a review

@jelbourn
Copy link
Member

Closing this since it's quite stale now. As of the recent #9379, TemplateRef dialogs should actually work all the way now, so the thing that was blocking this should be gone. Feel free to open a new PR if you want to take another go at it.

@jelbourn jelbourn closed this Jan 24, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants