angular2 forms validation - what does .ng-invalid:not(form)
angular, angular2-forms, css, forms
Solution
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.
Problem
Question What does the `:not(form)` part of a CSS selector for angular2 form elements? Context 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 */ } ```