This is exactly what I needed, thank you!

Angular doesn't handle ngForm in a ngRepeat well from the JavaScript end, 
because the nested form variable has the same name as per the form name, 
and there is no support for dynamic form names - I tried and failed.

>From the controller I was seeing:
$scope

.mainForm

.lineItemForm <---- This is the variable clash for the ngRepeat scoped form

 
Relying on a directive based approach now works well for me, because 
showing field validation errors are now scoped appropriately per nested 
form. And... using directives like this is really the more Angular way 
rather than creating thick controllers.

On Friday, 19 July 2013 08:07:44 UTC+12, [email protected] wrote:
>
> Hey, it's not that difficult finally, after hours of work :)
>
> Nested forms is the way to go, here is a working example using a directive 
> (with two levels of nested fields) : 
> http://plnkr.co/edit/pg2NJSdoF1JPmHmdpRnP?p=preview
>
> When an input is dirty and invalid, the error message is displayed.
>
> If the user submits the form while it's invalid, it will displays every 
> inputs with an validation error.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" 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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to