How to check if a Form has a required field on one of its control

315 Views Asked by At

I have the following form

  ethnicGroup: AbstractControl;
  form: FormGroup;
  type: AbstractControl;

constructor(
      private _fb: FormBuilder) {

    this.form = this._fb.group(
        {
          'type': [ '',  ],
          'ethnicGroup': [ '',  ]
        } );

    this.type = this.form.controls[ 'type' ];
    this.ethnicGroup = this.form.controls[ 'ethnicGroup' ]
  }

Is there a way to check if a form has a required field on one of its control?

Thanks

1

There are 1 best solutions below

1
On

You can check this by printing the form object in your console.