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

Commit

Permalink
fix(dialog): resolves issue where dialog templates were displaying HTML
Browse files Browse the repository at this point in the history
as text
  • Loading branch information
Robert Messerle committed Sep 24, 2015
1 parent e12512e commit ea9890f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ function MdDialogProvider($$interimElementProvider) {
'<md-dialog md-theme="{{ dialog.theme }}" aria-label="{{ dialog.ariaLabel }}" class="{{ dialog.css }}">',
' <md-dialog-content role="document" tabIndex="-1">',
' <h2 class="md-title">{{ dialog.title }}</h2>',
' <div class="md-dialog-content-body" md-template="::dialog.content"></div>',
' <div class="md-dialog-content-body" md-template="::dialog.mdContent"></div>',
' </md-dialog-content>',
' <div class="md-actions">',
' <md-button ng-if="dialog.$type == \'confirm\'"' +
Expand Down Expand Up @@ -520,15 +520,15 @@ function MdDialogProvider($$interimElementProvider) {
function wrapSimpleContent() {
if ( controller ) {
var HTML_END_TAG = /<\/[\w-]*>/gm;
var content = controller.content || "";
var content = controller.content || options.content || "";

var hasHTML = HTML_END_TAG.test(content);
if (!hasHTML) {
content = $mdUtil.supplant("<p>{0}</p>", [content]);
}

// Publish updated dialog content body... to be compiled by mdTemplate directive
controller.content = content;
controller.mdContent = content;
}
}

Expand Down

0 comments on commit ea9890f

Please sign in to comment.