We just recently updated our application Angular version to v5
and as part of new update Forms support ngFormOptions
to configure the validations f
As @Andriy mentioned in his comments
ngForms
selector isselector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]'
- source . Thus, usingformGroup
directive onform
will make thisform
as NOTngForm
andngFormOptions
will have no affect in this case.
Alternatively, we can use the said options in `component file as below:
this.testform = new FormGroup({
testcontrol: new FormControl('', Validators.required)
}, {updateOn: 'submit'});