Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip: ngbTooltip doesn't accept a new line

Tags:

angular

I want to add a line break inside my tool tip but it's not working, i tried everything from \n, <br>, &013;/ &#13

Here is my code:

<a>
 <img class="rounded-circle d-inline-block" src="{{content.image}}"  
 triggers="click" [autoClose]="true" ngbTooltip="{{content.email}} <br> 
 {{content.tel}}">
</a>
like image 226
koreangirl Avatar asked Jul 24 '19 11:07

koreangirl


1 Answers

You could use ng-template here and it would look like below. This should give you the list effect you are looking for. This is what I opted for and worked well.

Angular docs

<ng-template #list>
    <div class="d-flex flex-column">
      <span>{{ content.email}}</span>
      <span>{{ content.tel}}</span>
    </div>
</ng-template>


 <img class="rounded-circle d-inline-block" src="{{content.image}}"  
 triggers="click" [autoClose]="true" [ngbTooltip]="list">

Normal css for class="d-flex flex-column" outside of bootstrap would be

.example {
    display: flex;
    flex-direction: column;
}

explanation found here for flex css

like image 134
Dince12 Avatar answered Oct 23 '22 04:10

Dince12