Kar*_*aru 5 ng-bootstrap angular
我正在使用 Angular 2 和 ng bootstrap popover 功能。以下是我的 html。我有 infoIconText 变量,它有一些新行 \n 字符。但是,当我看到弹出窗口文本时,我仍然无法看到新行。如何设置弹出文本的样式?有什么建议么?
<i class="fa fa-info-circle" ngbPopover="{{infoIconText}}" triggers="mouseenter:mouseleave" aria-hidden="true"></i>
Run Code Online (Sandbox Code Playgroud)
我的infoIconText如下:
this.infoIconText = "This is line 1." +
"\nThis is line2";
Run Code Online (Sandbox Code Playgroud)
我能够通过创建模板并引用该模板来解决这个问题。
<ng-template #popContent>Line1<br>Line2</ng-template>
<i class="fa fa-info-circle info-icon-background popover-content" [ngbPopover]="popContent" placement="top" triggers="mouseenter:mouseleave" aria-hidden="true"></i>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2774 次 |
| 最近记录: |