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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -