Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add HTML to popover title in ngx-bootstrap

I'm trying to add a line break to a popover title in ngx-bootstrap.

Is that possible?

The line break tag below comes out as text, and for some reason ng-template seems to be within the popover body (not clear how to add title).

<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

like image 872
user749798 Avatar asked Dec 15 '25 05:12

user749798


1 Answers

No you cannot add HTML in the title.

But that doesn't mean we can't improvise

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>
like image 197
dota2pro Avatar answered Dec 16 '25 21:12

dota2pro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!