Hi (and sorry for my english!),

I created a form to fill information that are displayed in a table later.
So in view I make a ng-repeat to include data which come from the server, 
data base response (to include the information in my table).
But I would like in a second phase to be able to edit directly in the table 
this information.
Each input created by ng-repeat has actually an unique name because I 
integrated in this name the $index property.
My problem is that I don't know how to retrieve in the controller this 
specific name. 

This is the view, html part of my code:

<tr ng-repeat = "responseFnumElement in responses">
       <td ng-class="{'has-error': 
tableFieldsForm.fechaCompraInput{{$index}}.$invalid}"> // css part works, 
ie each table cell is taking in accound individually if evalidation error
         // How to retrieve name="fechaCompraInput{{$index}}" in 
controller????
         <input fix-name class="tdInput form-control" 
name="fechaCompraInput{{$index}}" type="text" ng-model= 
"responseFnumElement.fecha_compra" 
ng-pattern="/^2[0-9]{3}-[0-9]{2}-[0-9]{2}$/"/>
         <p class="help-block" 
ng-show="tableFieldsForm.fechaCompraInput{{$index}}.$invalid">Fecha entrada 
incorrecta</p> <!--Bootstrap class-->
        </td>

And the controller part of my code

// If I do :
var test = $scope.tableFieldsForm.fechaCompraInput17.$valid;
console.log(test); // it works, return true or false f(validation).

So .... How to retrieve name="fechaCompraInput{{$index}}" in controller????


Thanks a lt for your help, 

Pascal.

-- 
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/d/optout.

Reply via email to