Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

502
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda