【问题标题】:Add HTML to popover title in ngx-bootstrap在 ngx-bootstrap 中将 HTML 添加到弹出窗口标题
【发布时间】:2020-01-19 20:00:51
【问题描述】:

我正在尝试在ngx-bootstrap 中的弹出框标题中添加换行符。

这可能吗?

下面的换行标记以文本形式出现,由于某种原因,ng-template 似乎在弹出框正文中(不清楚如何添加标题)。

<ng-template #popTemplate>Just another: {{content}}</ng-template>
<button type="button" class="btn btn-warning"
        [popover]="popTemplate" popoverTitle="Template ref <BR> content inside">
  TemplateRef binding
</button>

https://stackblitz.com/edit/angular-ohncpd

【问题讨论】:

    标签: angular popover ngx-bootstrap


    【解决方案1】:

    不,您不能在标题中添加 HTML。

    但这并不意味着我们不能即兴发挥

    https://stackblitz.com/edit/angular-ohncpd-lbhdgg?file=app/custom-content.html

      <h3 class="popover-title popover-header" style="margin: -.5rem -.75rem 0 -.75rem;">Template ref <BR> content inside</h3>
      Just another: {{content}}
    
      </ng-template>
    
    
    
    <button type="button" class="btn btn-warning"
            [popover]="popTemplate" >
      TemplateRef binding
    </button>
    

    【讨论】:

      猜你喜欢
      • 2019-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-15
      • 2017-11-25
      • 2019-11-18
      • 2017-01-01
      • 2016-04-09
      相关资源
      最近更新 更多