Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External validator function #929

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

clmntr
Copy link

@clmntr clmntr commented Sep 26, 2017

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

  • I have read and understand the CONTRIBUTIONS.md file
  • I have searched for and linked related issues
  • I have created test cases to ensure quick resolution of the PR is easier
  • I am NOT targeting main branch
  • I did NOT include the dist folder in my PR

@json-schema-form/angular-schema-form-lead

Add the possibility to have an external validator function by passing to the validator an expression. Such as :
"$validators"  : {
  "equalsEmail" : "mustBeEqual(modelValue, 'email')"
}
@Anthropic
Copy link
Member

@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?

@clmntr
Copy link
Author

clmntr commented Sep 28, 2017

Sure, will do it when I have some time ;)

@clmntr
Copy link
Author

clmntr commented Nov 7, 2017

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

@clmntr
Copy link
Author

clmntr commented Jan 9, 2018

Hi @Anthropic, and Happy New Year !

Do you have any update on this PR ? Should I review some parts ?

Cheers

@Anthropic
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants