Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-dialog: support .html() for alert and confirm dialog? #1495

Closed
breezewish opened this issue Feb 13, 2015 · 12 comments
Closed

md-dialog: support .html() for alert and confirm dialog? #1495

breezewish opened this issue Feb 13, 2015 · 12 comments
Assignees
Milestone

Comments

@breezewish
Copy link
Contributor

I don't want to clone an alert / confirm dialog template & controller only to add newlines.
I prefer adding html() method or adding newline filter to alert & confirm dialog.

What do you think?

@marcysutton
Copy link
Contributor

Can't you use a custom template to create your own HTML? Alert and Confirm dialogs are meant to be presets.

@breezewish
Copy link
Contributor Author

Yeah, but I think alert and confirm should be 'behavioural presets' mainly, leave the content customizable (text or html).

@ilanbiala
Copy link
Contributor

@marcysutton what about allowing \n and \t to be parsed in the .title() and .content() strings?

@ThomasBurleson ThomasBurleson modified the milestone: 0.9.0 Feb 17, 2015
@ThomasBurleson
Copy link
Contributor

Since the $mdDialog uses <md-content>... </md-content>, I think the $mdDialog.alert().content( ) API should be used to insert any innerHTML content. Currently that method is used to inject text into a <p> area... which is not an intuitive API.

  • .content( ref ) should accept any unescaped string value (HTML) and inject as a child of the <md-content> container
  • .message( ref ) should accept any simple text and inject as the body of the of the <md-content><p>{ref}</p></md-content>

@ThomasBurleson ThomasBurleson self-assigned this Apr 11, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 0.10.0, 0.9.0 Apr 11, 2015
@ThomasBurleson ThomasBurleson changed the title md-dialog: support newlines for alert and confirm dialog? md-dialog: support .hmtl() for alert and confirm dialog? Apr 12, 2015
@kamarouski
Copy link

+1. Was thinking to implement my own version of confirm dialog as I need to bold some text in a message. As 0.10 milestone is in rc stage now I'll wait for this issue to be fixed.

@ThomasBurleson ThomasBurleson modified the milestones: 0.10.0, 0.11.0 Jun 16, 2015
@houmark
Copy link

houmark commented Aug 4, 2015

Any news here?

@ThomasBurleson
Copy link
Contributor

.content() will support simple strings or strings with HTML markup.

ThomasBurleson added a commit that referenced this issue Aug 14, 2015
…alogs

*  dialog`::onShow( )` now uses `wrapSimpleContent( )` to wrap simple strings in `<p>` tags
*  dialog basic demo `showConfirm( )` uses HTML span tag to illustrate use of HMTL content
*  implemented generic `md-template` to safely inject HTML content into an element

BREAKING CHANGE: dialog content text is now injected into **div.md-dialog-content-body**

Before the template used was:

```html
<md-dialog-content>
   <h2></h2>
   <p></p>
</md-dialog-content>
```

Now uses:

```html
<md-dialog-content>
   <h2></h2>
   <div class="md-dialog-content-body">
     <p></p>
    </div>
</md-dialog-content>
```

Fixes #1495.
@ThomasBurleson ThomasBurleson added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Aug 14, 2015
@naomiblack naomiblack modified the milestones: 0.12.0, 0.11.0 Aug 14, 2015
ThomasBurleson added a commit that referenced this issue Aug 14, 2015
…alogs

*  dialog`::onShow( )` now uses `wrapSimpleContent( )` to wrap simple strings in `<p>` tags
*  dialog basic demo `showConfirm( )` uses HTML span tag to illustrate use of HMTL content
*  implemented generic `md-template` to safely inject HTML content into an element

BREAKING CHANGE: dialog content text is now injected into **div.md-dialog-content-body**

Before the template used was:

```html
<md-dialog-content>
   <h2></h2>
   <p></p>
</md-dialog-content>
```

Now uses:

```html
<md-dialog-content>
   <h2></h2>
   <div class="md-dialog-content-body">
     <p></p>
    </div>
</md-dialog-content>
```

Fixes #1495. Closes #4148.
ThomasBurleson added a commit that referenced this issue Aug 15, 2015
…alogs

*  dialog`::onShow( )` now uses `wrapSimpleContent( )` to wrap simple strings in `<p>` tags
*  dialog basic demo `showConfirm( )` uses HTML span tag to illustrate use of HMTL content
*  implemented generic `md-template` to safely inject HTML content into an element

BREAKING CHANGE: dialog content text is now injected into **div.md-dialog-content-body**

Before the template used was:

```html
<md-dialog-content>
   <h2></h2>
   <p></p>
</md-dialog-content>
```

Now uses:

```html
<md-dialog-content>
   <h2></h2>
   <div class="md-dialog-content-body">
     <p></p>
    </div>
</md-dialog-content>
```

Fixes #1495.
@houmark
Copy link

houmark commented Aug 15, 2015

👍 Nice work! I'll be testing soon :)

kennethcachia pushed a commit to kennethcachia/material that referenced this issue Sep 23, 2015
…alogs

*  dialog`::onShow( )` now uses `wrapSimpleContent( )` to wrap simple strings in `<p>` tags
*  dialog basic demo `showConfirm( )` uses HTML span tag to illustrate use of HMTL content
*  implemented generic `md-template` to safely inject HTML content into an element

BREAKING CHANGE: dialog content text is now injected into **div.md-dialog-content-body**

Before the template used was:

```html
<md-dialog-content>
   <h2></h2>
   <p></p>
</md-dialog-content>
```

Now uses:

```html
<md-dialog-content>
   <h2></h2>
   <div class="md-dialog-content-body">
     <p></p>
    </div>
</md-dialog-content>
```

Fixes angular#1495.
@ThomasBurleson ThomasBurleson removed the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Jan 19, 2016
@metamatt
Copy link

In case anyone else wonders why they had this working in 0.11 and then it stopped working in 1.0: see 6a56450.

@rodwin
Copy link

rodwin commented Feb 22, 2016

Is there any specific reason why this has been removed?

@breezewish
Copy link
Contributor Author

You can use htmlContent()

@breezewish breezewish changed the title md-dialog: support .hmtl() for alert and confirm dialog? md-dialog: support .html() for alert and confirm dialog? Feb 23, 2016
@rodwin
Copy link

rodwin commented Feb 26, 2016

@summerwish You are right. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants