You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Unable to create dynamic input in forms and do error validation #1738
Im trying to create a dynamic form based on the fields in an entity and have it auto validate.
If I create each input in the form based on an ng-repeat, and set "name" and "ng-required" attribtues based on values in my scope, it doesn't seem to update the validation attributes when editing the form. If I supply a literal value for the "name" and "ng-required" attributes then it works fine.
@psi-4ward, there are PRs open to enable support for that, however Matias is working on some alternative solution for Angular.dart, and it might be backported. I agree that it's a bit silly that it's taken so long to resolve this, but work is being done on it.
In any case, I've created a plnkr demonstrating how you could get around this with current versions of angular using decorators: http://plnkr.co/edit/hSMzWC?p=preview (I know it's a bit silly, but it's what we've got right now for this)
Activity
pkozlowski-opensource commentedon Dec 20, 2012
You need to use http://docs.angularjs.org/api/ng.directive:form as described here: http://stackoverflow.com/a/12044600/1418796
Please ask on the mailing list if you need any further help with the code.
sparmboy commentedon Dec 20, 2012
Great thanks for that.
Here's the updated JSFiddle to prove it
psi-4ward commentedon Mar 11, 2014
not the best solutions, why cant we interpolate it?
caitp commentedon Mar 11, 2014
@psi-4ward, there are PRs open to enable support for that, however Matias is working on some alternative solution for Angular.dart, and it might be backported. I agree that it's a bit silly that it's taken so long to resolve this, but work is being done on it.
In any case, I've created a plnkr demonstrating how you could get around this with current versions of angular using decorators: http://plnkr.co/edit/hSMzWC?p=preview (I know it's a bit silly, but it's what we've got right now for this)