我想在mdDiaglog的.textcontent中添加换行符。以下是我的代码:
var confirm = $mdDialog.confirm()
.title('Refresh')
.textContent('Some information will be lost.'+'<br>'+ 'Do you want to refresh?')
.targetEvent(ev)
.ok('YES')
.cancel('NO');
$mdDialog.show(confirm).then(function () {
$window.location.reload();
});
}
使用.htmlContent()。
$ mdDialogPreset#textContent(string)-设置确认消息。$ mdDialogPreset#htmlContent(string)-将确认消息设置为HTML。需要加载ngSanitize模块。HTML不是通过Angular的编译器运行的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句