Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

501
Vistas
angular2 forms validation - what does .ng-invalid:not(form)

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 enter image description here

And their example code to achive the red bar looks like this

.ng-invalid:not(form)  {
   border-left: 5px solid #a94442; /* red */
}
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

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.

over 4 years ago · Santiago Trujillo Denunciar

0

The :not(form) part of the CSS selector represents elements that do not match a form element. So any DOM element excluding form elements.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda