Angular 15: no ngModelGroupOptions for ngModelGroup in template driven forms?

18 Views Asked by At

I am trying to implement template driven form with custom validations. In it, I want to validate the controls which are under my ngModelGroup on blur instead of triggering the validation as I type/change my inputs.

I can see we have ngFormOptions(for whole form level) and ngModelOptions(for control specific level), but there is no ngModelGroupOptions? We do have formGroupOptions support in Reactive Forms though:

  this.fb.group(
  {
    name: ["", [Validators.required]],
    email: ["", [Validators.required, Validators.email]]
  },
  { updateOn: "blur" }
);

Any reason why this support is not provided in template driven forms? Can someone please help on how can I specifically set my formGroup's updateOn without setting it on whole form or individual controls in this case?

0

There are 0 best solutions below