0

I'm using ngx-translate.

How can I put a line break in a standard html tooltip to translate ?

In my template I have :

<div [title]="'TOOLTIP_STRING' | translate">hover here</div>

In my en.json:

{
"TOOLTIP_STRING": "Tooltiptext&#13;Another line etc etc.&#13;Text on second line"
}

I tried \n <br/> <br> Nothing works. If I make the text static (just type it in the html) it works fine.

Babulaas
  • 761
  • 3
  • 13
  • 47
  • have you tried `
    ` ?
    – Nicolas Nov 27 '19 at 14:53
  • Yes, I also mentioned it in my question – Babulaas Dec 02 '19 at 11:37
  • you could try to [try to use innerHTML](https://stackoverflow.com/questions/39126299/typescript-append-html-to-container-element-in-angular-2) , this way your string will be interpreted as HTML and your `br` will be correctly recognized. – Nicolas Dec 02 '19 at 12:52
  • InnerHtml is for rendering the inner HTML/The content inside the div. I need a new line in the tooltip. – Babulaas Dec 04 '19 at 14:03

0 Answers0