-
Notifications
You must be signed in to change notification settings - Fork 649
Put many forms in same $scope and validate for separate. #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @mrpotato3, one easy way to make these work separately is to use 3 separate controllers: <div ng-controller="form1"> ... </div>
<div ng-controller="form2"> ... </div>
<div ng-controller="form3"> ... </div> This way $scope broadcast will only effect the form on the same or child scopes. |
Hi @mike-marcacci! |
I'd say that @mike-marcacci solution sounds good! |
I also had this issue and I disagree that multiple controllers is a good solution. Reason being, it drastically increases complexity in some scenarios, such as when you want to share form behavior logic across different parts of the app. It forces you to make multiple controllers all over the place that do nothing but use a single service. |
+1, you should not have to declare multiple controllers to manage just one service gets repetitive and goes agains DRY principles |
Hi. I have a problem with form validation. I need to put more than one different forms and validate/send data separate.
I have:
I hope somebody can help me.
Thanks!
The text was updated successfully, but these errors were encountered: