如何在$ mdDialog中的textContent中添加换行符

用户名

我想在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();
  });
}
克莱门特·邓格勒(Clement Dungler)

使用.htmlContent()。

$ mdDialogPreset#textContent(string)-设置确认消息。$ mdDialogPreset#htmlContent(string)-将确认消息设置为HTML。需要加载ngSanitize模块。HTML不是通过Angular的编译器运行的。

文献资料

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章