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

167
Vistas
"hidden" with brackets doesn't work in Angular

I add [hidden]="true" to an HTML element in Angular, but the element is still visible. I noticed that when I remove the [] from around hidden, the element is now hidden as desired. Why won't [hidden]="true" work with brackets? I see many references to it on stackoverflow and elsewhere but can't get it to work. Is this deprecated?

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

try this. hope it will help you.

<div [hidden]="'true'"><div/>

about 4 years ago · Juan Pablo Isaza Denunciar

0

It should work like you explained. Otherwise something else is overwriting hidden. For example:

Some styles can overwrite hidden. Styles and classes may be inherited from somewhere?

<input [hidden]="true" style="display: block">

It would be possible to explicitly not allow that. This might be useful if you don't want to change conflicting classes rather just force this on.

[hidden] {
  display: none !important;
}

Alternative could be to use dispaly: none:

<input [style.display]="'none'">

This input is hidden but still in the DOM.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Thanks to everyone for your responses. I just realized this is because I'm trying to use this inside of index.html, which is outside of the Angular entry point.

about 4 years ago · Juan Pablo Isaza 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