With AngularJS, I'm trying to build dynamically a form from a json.
Fiddle : http://jsfiddle.net/586pB/2/
You can see in the fiddle that :
- generating form is ok
- auto disabling submit button is ok
But, input validation doesn't work.
ng-class="{ 'has-error' : entryForm[field.id].$invalid && !entryForm[field.id].$pristine }"
This code is working when it's not in a loop : entryForm.title.$invalid
. But not with this syntax : entryForm[field.id].$invalid
Thanks for your help.
Edit : solved Found my answer here : https://github.com/angular/angular.js/issues/1404 Each form-group is now a form, and each input has a static name.