我在AngularJS + Bootstrap3中有以下要求 - 触发模态对话框时需要复制并将当前表行值传递给模态对话框输入
我的代码在这里 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 :(得分:0)
您可能需要使用以下模板标记,
<div class="modal-content">
<div class="modal-header">
<div class="modal-body">
//you table template tag comes here...
</div>
</div>
</div>