Example how to configure a custom validator
See original GitHub issueIn our case the form schema is loaded through AJAX and a field defines a validator like
validator: 'my_validators.is_int'
I have a my_validators.js file which is loaded from the HTML (no JS packaging involved) like
<script type="module" src="my_validators.js"></script>
How can I attach/export my implementation of is_int()
function is_int(value) {
// do something
}
as module in order to make it visible to VFG?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Angular Custom Form Validators: Complete Guide
a custom validator is a function that validates the value of a form field according to a business rule, such as form example...
Read more >The best way to implement custom validators - Angular inDepth
First, we will have a look at some built-in operators and then learn how to implement a custom validator on our own (this...
Read more >How to Create Custom Validators in Angular - DZone
Create a factory function and pass parameters that will be passed to the custom validator to this function. · The return type of...
Read more >Validating form input - Angular
In this example, the name control sets up two built-in validators — Validators.required and Validators.minLength(4) — and one custom validator, ...
Read more >Creating a custom validator - FormValidation
Registering custom validator. There are two ways to reuse a custom validator. Adding to FormValidation.validators namespace.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@vahidalvandi
not work for me !!