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

396
Visualizações
angular 12 Universal, fail html validation with error on app selector

Any ideas what to do, whit this error?

The simple test as angular v12, Universal SSR fail the W3 HTML validation.

the AppComponent have a selector like:

@Component({
selector: 'app',
templateUrl: './app.component.html',
encapsulation: ViewEncapsulation.None
})

and on index

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <app id="app"></app>
</body>
</html>

But W3 HTML validation shows an error:

enter image description here

I also try to change the selector name to like: 'project' and I got the same error

enter image description here

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Edit : use a name with a hyphen, like app-root

Strangely, the validator won't complain about app root or other angular directive tags, but it will complain about all _ngcontent-** attributes.

Note that there is a message filtering function in the w3c validator so you can ignore specific warnings (such as the _ ngcontent-** attribute) (message from w3c maintainer here )

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