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

209
Vistas
Why does angular checkbox gets toggled even if I provide value as false?

In react

<input type='checkbox' checked={true} />

makes the checkbox non toggleable.

However the same in angular makes it toggleable?

<input type='checkbox' [checked]=true />

My use case is multi select dropdown with an max selection value in it. So if the selection is maxed I shouldn't let the user select an option.

Currently I've made it using disabled option something like this.

<input type="checkbox" [name]="option.label" [checked]="option.isSelected"
               [disabled]="!option.isSelected && max === selected.length"
               (change)="toggleSelectedItem(option.id)">

But I would like to know the reason behind such behaviour in angular? By such behaviour I mean in react if the checked attribute is set to true it doesn't allow user to check or uncheck the item which is what is expected. Why isn't it the case with angular?

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