you can have dynamic field name. but you must create an directive with 
controller, that sets name attribute.

you can read more about it here.

https://groups.google.com/forum/#!topic/angular/YFVb5d54dY0

On Thursday, November 1, 2012 9:08:25 PM UTC+1, [email protected] wrote:
>
> i have a form that gets created dynamically in a view.
> <pre>
>   <form id='pickForm' name='pickForm' ng-submit="submitPicks()">
>   <ul>
>    <li   ng-repeat="list in lists">
>       <input name="input-{{list.id}}" ng-model="game.myvalue" 
> class='input-mini pickValue'  >
>     </li>
>    </ul>
>  <input type='submit' class='btn btn-inverse' ><i 
> class='icon-upload'></i></input>
> </form>
>
> what i would like to do is a validation in my submit function to do some 
> validation and update the $error on the element but all i ever can get back 
> is the htmlElement 
>
> an exmple is
>
> myAppApp.controller('MyCtrl', 
> function($scope,$rootScope,$resource,$http,mockUserPick) {
>    
>   function validate(){
>      $('pickValue').each(
>        function(index,value){
>            //do some checks
>            if(value.val() > 99){
>              //here i would like to set the $error but there is no $error 
> on this element and i don't know how to get it.
>            }
>         });
>   }
>
>   $scope.submitPicks = function(){
>     validate();
>    }
> });
> }
>

-- 
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