We have a requirement to change attributes of form fields like "required", 
"hidden", "maxLength" based on selection of one or more fields on the form.

For eg: Based on country selected from a dropdown, the city,state,address1, 
address2, address3 attributes should change. State may be mandatory for US 
but not India.

Currently we are using a server side technology JSF2 to implement the view. 
Spring REST is used as backend. All these country based rules are currently 
stored in a database table. On application start up these are loaded in 
memory and derived based on country selection in the view.

In case we need to switch the view to angular 4, please advice if we can 
reuse this existing rules configuration table to dynamically update the 
attributes of form fields based on country selection?

Based on checking, angular 4 reactive forms seems to what we can use. It 
has FormValidators but not sure if these can be dynamically derived/changed 
based on country based rules derived from backend REST service (in JSON) 
when country is changed.

Any pointers would be highly appreciated。

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" 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