I have an input that has a FormControl and I want it to work with :invalid i.e.
scss
input:invalid {
background-color: red;
}
html
<input type="text" [formControl]="NameCtrl">
but it is not working with it. Although it is working with required i.e.
input:invalid {
background-color: red;
}
<input type="text" required>
How to decorate input field with error styles with FormControl. Any idea, solution, or workaround would be highly appreciated.