I need to implement search (Like find in page) . I have rendered an XML in my HTML page. I need to search for a text in this rendered XML. I have set the XML as the innerhtml of a div. I have used IgxTextHighlightDirective for searching and highlighting the search text.
This is my data
this.htmlData = this.sanitizer.bypassSecurityTrustHtml(xmld);
And this is what i have written in my HTML template
<div class="xml-view" (dblclick)="selectEntryText($event)">
<div [innerHTML]="htmlData" igxTextHighlight [value]="htmlData" class="search-text">
</div>
</div>
After typing in the search box. This is my problem.
It looks like you haven't added the necessary styles. Also, for what exactly you use the
innerHtml
input? As I can see you've correctly set thevalue
input and as long as you execute thefind
equivalent of your logic, the search capabilities should be working fine.Check out this sample and topic for more information on how to use the text highlight directive