angular-schema-form
angular-schema-form copied to clipboard
External validator function
Add the possibility to have an external validator function by passing to the validator an expression. Such as : "$validators" : { "equalsEmail" : "mustBeEqual(modelValue, 'email')" }
Description
Add your description here
Fixes Related issues
- add related
- issues here
Checklist
- [x] I have read and understand the CONTRIBUTIONS.md file
- [x] I have searched for and linked related issues
- [ ] I have created test cases to ensure quick resolution of the PR is easier
- [x] I am NOT targeting main branch
- [x] I did NOT include the dist folder in my PR
@json-schema-form/angular-schema-form-lead
@BulletAnt thanks for this, could you add a quick test case or show me a plunker that shows it working I can make a test case from?
Sure, will do it when I have some time ;)
Hi!
I finally took the time to create a plunker that shows the "external" validator.
Here you go: https://plnkr.co/edit/izM9FPnz8O3IewgquxZd
Plus, in my project version (based on the bower version) I also added this to the parsers, and allow the $validators/$parsers/etc... definition directly in the schema. As I use one schema for two forms, it is easier to define those in the schema instead of the form. Let me know if you want me to add this in another PR.
Cheers
Hi @Anthropic, and Happy New Year !
Do you have any update on this PR ? Should I review some parts ?
Cheers
Hi @BulletAnt thanks for the nudge, I missed your Nov update! I'll take a look shortly, Nov-Jan were a write-off unfortunately, way too busy with work and then holidays.