tho*_*mas 2 html css angularjs
假设我有这样的文字:
$scope.text = 'This is the first line\nthis is the next line';
Run Code Online (Sandbox Code Playgroud)
我想在使用 angular 的 div 标签中显示它
<div>{{text}}</div>
Run Code Online (Sandbox Code Playgroud)
如何显示这个文本格式与换行?现在它显示如下:
这是第一行这是下一行为了清晰起见,内联样式
<div style="white-space: pre;">{{ text }}</div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1702 次 |
| 最近记录: |