2017-04-17 70 views
0

我在AngularJS以下要求+ Bootstrap3 - 当触发模式对话框需要复制当前表行值传递给模态对话框输入NG-点击不工作的引导模式对话框

我代码是在这里 HTML:

<table class="table" data-sorting="true" data-paging="true" data-paging-size="10" 
     data-paging-position="right" data-paging-count-format="{CP} of {TP}"> 
    <thead> 
    <tr> 
     <th data-breakpoints="xs" data-type="number">S.No</th> 
     <th>Name</th> 
     <th>Authorization</th> 
     <th>Actions</th> 
    </tr> 
    </thead> 
    <tbody> 
    <tr ng-repeat="test in vm.testData"> 
     <td>{{$index + 1}}</td> 
     <td>{{test.test}}</td> 
     <td> 
     <div ng-show="test.authorize">Authorized</div> 
     </td> 
     <td> 
     <button type="button" class="btn btn-primary" ng-click="vm.showEditDialog(test, $event)"> 
      Edit 
     </button> 
     </td> 
    </tr> 
    </tbody> 
</table> 

<div class="modal fade" id="editTestModal" tabindex="-1" role="dialog" aria-labelledby="editTestLabel"> 
</div> 

的JavaScript:

vm.showEditDialog = function (test, event) { 
    vm.selectedTest = angular.copy(test); 
    $("#editTestModal").modal('show'); 
}; 
+0

您需要使用ui.bootstrap的$模式服务,信息提供https://angular-ui.github.io/bootstrap/,HTTPS://plnkr.co/edit/ p =预览 –

回答

0

您可能需要使用模板标签下面,

<div class="modal-content"> 
     <div class="modal-header"> 
      <div class="modal-body"> 
        //you table template tag comes here...      
      </div> 
     </div> 
    </div>