Have you got any solution? I am having the same issue for similar scenario.

Thanks
Kalyan

On Thursday, August 18, 2016 at 1:56:41 AM UTC-4, Swetha wrote:
>
>
> *Please help me inorder to implement below requirement.*
>
> I have developed model driven forms using angular 2 and tried to perform 
> dynamic conditional required field validations.
>
> Please find my plunker here.
>
> https://plnkr.co/edit/C1NwMvrSZFbPOWkCwxC2?p=preview
>
> I have one drop down and two input controls in my sample code.My 
> requirement is :
>
> 1. When user selects foreign option in select box ,I should apply required 
> validator for house number and building name in component class.
>
> 2. When user selects local option in select box , I should remove required 
> validator for house number and building name. But minlength ,pattern 
> validations should be applied to the controls.(If user doesn't enter the 
> data then no problem. If user enter data in house number and building name 
> even though those are optional I should validate pattern and minlength 
> etc...)
>
>
> Note: My select box data is not static , In my real time requirement I 
> will get the data from service and binds the data to it. In sample I have 
> used only two options for easy understanding.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to