ngx-sub-form icon indicating copy to clipboard operation
ngx-sub-form copied to clipboard

Enforce `Validators.required` on required fields

Open maxime1992 opened this issue 4 years ago • 2 comments

This issue would solve a subset of #147.

It's possible to find in an object type:

  • all the optional keys
  • all the keys where the values can be either null or undefined

So basically, we're able to ask the consumer to write down all the required and non nil keys. We could then dynamically onto the form group add Validators.required on all of those (+ add a global check on the form to make sure that if some values are disabled, they're still required at the form level).

maxime1992 avatar May 07 '20 08:05 maxime1992

Hi @maxime1992 ! I would like to work on this feature if no one else is working on it.

noobyogi0010 avatar Nov 27 '21 19:11 noobyogi0010

@noobyogi0010 wow sorry for the delay here, I completely forgot about this thread, just found it randomly :exploding_head:.

We recently merged the rewrite so that's a good timing.

If you're still up for it, defining and agreeing on the API would be the first step :)

@zakhenry do you reckon that's a good idea or can you think of anything against that?

maxime1992 avatar Jan 03 '22 17:01 maxime1992