DEV Community

Discussion on: Highlight text in paragraphs with a simple directive in Angular

Collapse
 
ribizlim profile image
Mark Magyarodi

nice solution, but what happens if the element has nested HTML tags? those are not returned by textContent right?

Collapse
 
adisreyaj profile image
Adithya Sreyaj

Yup...if there is nested tags, we may need to either provide the text content as input or maybe pass a selector for the text element as input.