簡體   English   中英

動態告警服務 Angular

[英]Dynamic Alert Service Angular

我正在使用動態 Angular 警報服務。 有沒有辦法設置文本樣式,使某些單詞變粗並添加新行並使其他部分居中。 我希望成功以粗體和居中以及下一行的 rest 我嘗試添加'\n''\b' <strong>等,但它似乎不起作用。 我想避免在全局服務中手動輸入它。:

this.alertService.success( "Success! you have successfully submitted your request") 

您好,您可以使用
而不是 /n 還記得文本必須添加為 x.innerhtml 所以像這樣

    whateverfunction( "<strong>Success!</strong><br> you have successfully submitted your request")
function whateverfunction(text){
//other code
x.innerhtml = text
}

這應該有幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM