首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在触发引导模式对话框时,ng-click不起作用

在触发引导模式对话框时,ng-click不起作用
EN

Stack Overflow用户
提问于 2017-04-17 19:48:46
回答 1查看 252关注 0票数 0

我在AngularJS + Bootstrap3中有以下要求-在触发模式对话框时,需要复制当前表行的值并将其传递给模式对话框输入

我的代码是HTML:

代码语言:javascript
复制
<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:

代码语言:javascript
复制
vm.showEditDialog = function (test, event) {
  vm.selectedTest = angular.copy(test);
  $("#editTestModal").modal('show');
};
EN

回答 1

Stack Overflow用户

发布于 2017-04-17 20:08:05

您可能需要使用模板标签,如下所示:

代码语言:javascript
复制
    <div class="modal-content">
        <div class="modal-header">
             <div class="modal-body">
                    //you table template tag comes here...                    
            </div>
        </div>
    </div>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43450900

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档