ABS Material Basic Properties

ABS Material Basic Properties , ABS Material Basic Properties

ABS Material Basic Properties

There are a couple of common reasons why a “required” validator (or any validator) might not fire when you use a custom checkbox-group in Angular reactive forms:

  1. You are using a custom component (checkbox-group) that is not wired up as a real form control.
    • In Angular reactive forms, any custom form element (like a custom checkbox-group) must implement the ControlValueAccessor interface so Angular knows how to read from and write to it. If checkbox-group is just a regular component without ControlValueAccessor, Angular has no idea about its current value or whether it has been “touched,” “dirty,” etc. As a result, validators won’t trigger.
  2. store_ids is set up as a string ('') instead of an array (e.g. [])
    • From your code, it looks like personaForm.controls.store_ids.value.includes(store.id) is being used, implying that store_ids should be an array of selected IDs. However, in your FormGroup initialization, you wrote: