下拉链接需要多次单击才能打开弹出窗口

时间:2018-12-05 08:13:15

标签: html typescript bootstrap-4

我已经将我的用户操作链接放在一个下拉列表中,应该根据要单击的链接打开一个弹出表单或对话框。我正在使用引导程序4。

这是我的代码:

findUser($) {
        this.user.getById($.target.id).subscribe(res => {
            if (res.success === true) { this.isEdit = true; this.singleUser = res.data[0]; console.log('editable', this.singleUser) }
            else {
                this.toastr.error('An Error Occured, Please Try Again.', '', {
                    timeOut: 3000,
                    positionClass: 'toast-top-center'
                });
            }
        })
    }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<td>
  <div class="dropdown">
    <button class="btn btn-info dropdown-toggle" aria-haspopup="true" aria-haspopup="true" type="button" data-toggle="dropdown">Action
    <span class="caret"></span></button>
    <ul class="dropdown-menu">
      <li><a id='{{item._id}}' (click)='findUser($event)' data-toggle="modal" data-target="#m_modal_5">Edit</a></li>
      <li><a id="{{item._id}}" (click)='deleteUser($event)'>Delete</a></li>
    </ul>
  </div>
</td>

谁能说出问题所在?我已经尝试过Google,但是这些解决方案都行不通。

已解决: https://github.com/angular-ui/bootstrap/issues/2294

1 个答案:

答案 0 :(得分:0)

所以我删除了data-toggle ='dropdown'并开始工作。请点击此链接以获取更多信息。

https://github.com/angular-ui/bootstrap/issues/2294