Software engineer, I've been working with Angular for 6 years now and strive to work more full stack. I publish on dev.to about topics I love around open source, frontend, data privacy, automations.
and checkout the latest version working with angular 7
git checkout v2.7.1
From there you'll have the README and the whole demo project working with Angular 7.
If you want to use new features that appeared after 2.7.1 or take advantage of the latest bug fixes you'll have to upgrade to Angular 8 and then use the latest of ngx-sub-form.
Hope it makes sense.
If you can and there's no particular blocker, I'd recommend upgrading to Angular 8 anyway :)
Thanks. Is there any way to add a custom validation for the entire group? Normally, I'd do so like this:
createFormGroup() {
this.myForm = this.fb.group({
mobile : new FormControl(''),
homePhone : new FormControl('')
// our custom validator
}, { validator: this.atLeastOnePhoneRequired});
}
but in the form using ngx-sub-form I'm using code like this:
protected getFormControls(): Controls {
return {
mobile : new FormControl(null),
homePhone : new FormControl(null)
};
}
Software engineer, I've been working with Angular for 6 years now and strive to work more full stack. I publish on dev.to about topics I love around open source, frontend, data privacy, automations.
So do you have sample code that works with 2.7.1 or do I need to upgrade to angular 8 in order to get my code working?
Thanks,
Andrew
You can clone the project:
git clone git@github.com:cloudnc/ngx-sub-form.git
and checkout the latest version working with angular 7
git checkout v2.7.1
From there you'll have the README and the whole demo project working with Angular 7.
If you want to use new features that appeared after 2.7.1 or take advantage of the latest bug fixes you'll have to upgrade to Angular 8 and then use the latest of ngx-sub-form.
Hope it makes sense.
If you can and there's no particular blocker, I'd recommend upgrading to Angular 8 anyway :)
Thanks. Is there any way to add a custom validation for the entire group? Normally, I'd do so like this:
createFormGroup() {
this.myForm = this.fb.group({
mobile : new FormControl(''),
homePhone : new FormControl('')
// our custom validator
}, { validator: this.atLeastOnePhoneRequired});
}
but in the form using ngx-sub-form I'm using code like this:
protected getFormControls(): Controls {
return {
mobile : new FormControl(null),
homePhone : new FormControl(null)
};
}
Yes, there's definitely a way to do that.
Search
getFormGroupControlOptions
on the README :)