0

The application has a rather complicated form. File upload, several select2-fields and couple xeditables. These extras do not support ng-dirty very well. I want to enable 'Submit' button only when all the fields are valid and the file upload passes a server side validation.

Are there some design patterns for managing such a multifaceted validation in Angular?

2 Answers 2

1

Use a service to calculate if the complicated conditions are met.

Then bind the result, say "condition1", of the complicated calculation, to a ng-switch.

http://docs.angularjs.org/api/ng.directive:ngSwitch

ng-switch is the more robust because DOM that does not satisfies the condition is not loaded.

Sign up to request clarification or add additional context in comments.

Comments

0

Yes, you can use:

ng-if="conditions"

Or :

ng-show="conditions"
ng-hide="conditions"

Tray to write more specyfic where is the problem and that what you want is very easy to find in angularjs documentation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.