Is there a way to highlight the text in a textbox using Angular and Material design? I've tried the code below but it's not working for me.
I'm looking to apply the highlighting conditionally based on a boolean variable called 'highlightTextFlag', possibly using ngStyle.
Example:
input::first-line {
background-color: green !important;
}
Current code:
<mat-form-field>
<mat-label>Test</mat-label>
<input
matInput
[ngStyle]="{'input::first-line': 'green' }"
>
</mat-form-field>
https://i.sstatic.net/1U7k9.png
How to highlight text inside an input field?
Angular Material: Highlight Words in a Textbox