Okay, so the title might not be the greatest...but I couldn't think of anything better:
I want to emphasize search keywords in the result list...that's why I'm having trouble with this problem. CSS:
.highlightText{
font-weight: bold;
}
In TypeScript:
myVariable = "hello world";
keyword=" bonjour";
highlightText(text: string){
return text.replace(keyword, "<span class='highlightStyle'>"+keyword+"</span>");
}
In HTML:
<div>
{{highlightText(myVariable)}}
</div>
On the screen, I see the whole text..:
< span class='highlightStyle' >bonjour< /span > world
But what I really expect is: bonjour world
That's it :D
any ideas?
Thanks,Csaba