Skip to content

Extend validators

Chris Knight edited this page Jul 23, 2018 · 6 revisions

Overview

ng-form-rules aims to integrate seamlessly with Angular reactive forms and never block you from getting your work done. While ng-form-rules can handle most scenarios and use cases we also know that that every project has unique requirements and constraints. We leave the door open for your to extend the functionality as you need it. This entails allowing you to manipulate the FormGroup we create.

Extending validators

View example

You can add custom (or Angular's built in) validators alongside ones created by ng-form-rules based on your model settings by calling extendValidator() or extendAsyncValidator() from ReactiveFormsRuleService. Simply pass these functions the form control you want to extend the validators for and the validators you want to add.

Clone this wiki locally