在Angular 5应用程序中,我需要显示一些来自数据库的HTML。例如,数据库中的文本可以是
<div><u>Documents and Files</u></div><ul><li>These documents needs to be tested and reviewed. Please check the details.</li></ul>
在应用程序中,它显示为
使用以下代码
<div [innerHTML]="description"></
假设我有以下字符串:
"This line should always break on newline \n, spaces if it is about to overflow and veryLongLinksThatDoNotFitInsideTheDiv"
我要它破门而入
\n (总是)
空格(如果它即将溢出)
长单词(如果它不适合整一行)
但最好不要随意使用适合下一行的小单词()
基于,我尝试:
<div id="log" style="word-break: break-all"><