What does the :not(form)
part of a CSS selector for angular2 form elements?
The current version of the Angular2 tutorial about forms makes use of two-way data binding, change tracking and validation to add CSS classes to form elements.
Their example form looks like this
And their example code to achive the red bar looks like this
.ng-invalid:not(form) {
border-left: 5px solid #a94442; /* red */
}
Ah, I found it out myself!
the ng-invalid
class is <form>
elements, too.
So, :not(form)
is added to prevent a red bar on the left side of the whole form.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With