Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48983

Access multiple form control values from the same formgroup from a customValidator

$
0
0

Hi!

I’m trying to implement a reactive form with a formgroup of 2 elements and a validator to access the 2 elements simultaneously. How can this be achieved?

eg:
this.formBuilder.group({
var1: [’’, [Validators.required, customValidator]],
var2: [’’, [Validators.required, customValidator]]
});

The use case scenario is var1 must never be greater than var2 and var2 must never be less than var1.

Thank you.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 48983

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>