If you must put a newline in title
then replace the HTML <br>
with new line n
.
<div [innerHTML]="myAngularVariable" title="{{myAngularVariable.replace('<br>','n')}}"></div>
If you must put a newline in title
then replace the HTML <br>
with new line n
.
<div [innerHTML]="myAngularVariable" title="{{myAngularVariable.replace('<br>','n')}}"></div>
I have an angular variable myAngularVariable=”some<br>HTML text
” and a div
<div [innerHTML]="myAngularVariable" title="{{myAngularVariable}}"></div>
This way, inside the div I get the HTML of the variable interpreted, i.e. inside the div the result shown is
some
HTML text
but when i hover to show the title tooltip I get “some<br>HTML text
“.
There is a way to show on hover the HTML text interpreted?
it is not supported by the HTML, so no way to make it work without making a separate “title” directive which will render a popup with html supported
tnx, but it is a general problem with HTML, non only with br
Plenty of solutions if you search, e.g.