I want to add line break in .textcontent of mdDiaglog. Following is my code:
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();
});
}
write css class in your styles and use '\n' instead of <br>
in textContent()
.md-dialog-content-body p{
white-space: pre;
}
Use .htmlContent().
$mdDialogPreset#textContent(string) - Sets the confirm message. $mdDialogPreset#htmlContent(string) - Sets the confirm message as HTML. Requires ngSanitize module to be loaded. HTML is not run through Angular's compiler.
Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With