html - getting values of auto generated input fields angularjs -


i stuck problem while now, trying values auto generated input fields 1 click can values of generated inputs @ once.

this part of html inputs created :

<div ng-controller="ingredientcontroller ctrl" class="col-md-12">     <div class="col-md-4" ng-repeat="ingredientgroup in ctrl.ingredientcontainer">         <div  ng-repeat="group in ingredientgroup">             <div ng-if="!group.groupid"><h3>{{group.name}}</h3></div>             <div ng-if="group.groupid">                 <div class="form-group">                     <label>                         {{group.name}}<input type="text" class="form-control">                     </label>                 </div>             </div>         </div>     </div> </div> <div class="modal-footer">     <button type="button" class="btn btn-default" ng-click="$dismiss()">close</button>     <button type="button" class="btn btn-primary" ng-click="$close(ctrl.product)">ok</button> </div> 

you can make use of array structure. declare $scope variable myinput in controller

$scope.myinput = []; 

use variable inside ng-repeat

{{group.name}}<input type="text" class="form-control" ng-model="myinput[{{group.groupid}}]"> 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -