[英]Put a line break (newline) into a toastr message in AngularJS?
有兩種方法可以在toast中允許一些HTML標記,包括換行符。
在toaster-options
包含'body-output-type': 'trustedHtml'
:
<toaster-container toaster-options="{
'closeButton': false,
'debug': false,
'position-class': 'toast-bottom-right',
'onclick': null,
'showDuration': '200',
'hideDuration': '1000',
'timeOut': '5000',
'extendedTimeOut': '1000',
'showEasing': 'swing',
'hideEasing': 'linear',
'showMethod': 'fadeIn',
'hideMethod': 'fadeOut',
'body-output-type': 'trustedHtml'
}"></toaster-container>
或者在調用toaster.pop()
包含'trustedHtml'
:
toaster.pop('success', 'Saved', 'Saved<br/>it!', 3000, 'trustedHtml');
要么
toaster.pop({
type: 'success',
title: 'Saved',
text: 'Saved<br/>it!',
bodyOutputType: 'trustedHtml'
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.