angularjs - Pass values of ng-repeat outside it as parameters on button click -


i have following code structure inside modal-popup, i've populated rows of table using ng-repeat. want pass values of 3 columns of rows controller dont know how able use data outside ng-repeat scope , pass controller. here's code snippet -

    <div class="inmodal">         <div class="modal-header" ng-model="modaldetails">             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">&times;</button>             <img ng-src={{$root.varimg}} class="m-b-md" alt="profile">             <h4 class="modal-title">{{$root.assetgrpnm}}</h4>         </div>         <div class="modal-body" >             <div class="wrapper wrapper-content animated fadeinright">                 <div class="row">                     <div class="col-lg-12">                             <div class="table-responsive">                                        <div ng-repeat="dataag in detail.outerdata" >                                     <table class="table table-striped table-bordered table-hover">                                         <thead>                                         <!-- --------- tried using piece of code thinking atleast values inside ng-repeat scope                                              <tr><button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="save(deviceid,datadevicedata.measurementdata,newdevicevalue,datadevicedata.lastreadingdatetime)">save</button></tr>                                            -->                                             <tr>                                                 <th>id</th>                                                 <th>name</th>                                                 <th>last value</th>                                                 <th>current value</th>                                                 <th>date time</th>                                             </tr>                                         </thead>                                         <tbody>                                             <tr ng-repeat="datadevice in dataag.innerdata track $index">                                                 <td>                                                 <span style="font-weight: 800;"><span ng-model="deviceid">{{datadevice.manageddeviceinfo.id}}</span>&nbsp;-&nbsp;{{datadevice.manageddeviceinfo.deviceexternalid}}</span>                                                 </td>                                                 <td ng-repeat="datadevicedata in datadevice.devicecoredata">{{datadevice.manageddeviceinfo.devicename }}&nbsp;-&nbsp;<span class="text-center">({{ datadevicedata.quantityunitsymbol }})</span></td>                                                 <td ng-repeat="datadevicedata in datadevice.devicecoredata">                                                     <input type="number" class="form-control" id="modal_val" ng-model="datadevicedata.measurementdata" required style="width: 100px;"></td>                                                 <td ng-repeat="datadevicedata in datadevice.devicecoredata">                                                     <input type="number" class="form-control" id="modal_val" ng-model="newdevicevalue" required style="width: 100px;"></td>                                                 <td style="position: relative;">                                                  <div id="datetimepicker1-{{$index}}" class="input-append date">                                                     <input data-format="dd/mm/yyyy hh:mm:ss" type="text" ng-model="datadevicedata.lastreadingdatetime"></input>                                                     <span class="add-on"><i data-time-icon="icon-time" data-date-icon="icon-calendar"></i></span>                                                 </div>                                           </td>                                         </tr>                                     </tbody>                                 </table>                               </div>                             </div>                         </div>                  </div>             </div>         </div>     </div>     <div class="modal-footer">      <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="save(deviceid,datadevicedata.measurementdata,newdevicevalue,datadevicedata.lastreadingdatetime)">save</button>           <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="ok()">cancel</button>     </div> </div> 

below image showing logic - ng-repeat logic


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -