使用angular5和bootstrap4单击后,下拉菜单按钮不会关闭

时间:2018-08-08 14:11:51

标签: javascript html angular bootstrap-4

这是代码

some.component.html

<div class="btn-group dropdown" normalizePosition ng-click="toggle()">
<button class="dropdown-toggle btn btn-sm btn-primary"
        data-toggle="dropdown"
        aria-haspopup="true"
        aria-expanded="false">
    <i class="fa fa-cog"></i><span class="caret"></span> {{l("Edit")}}
</button>
<ul class="dropdown-menu">
    <li>
        <a (click)="openReport(id)">{{l('Run Report')}}</a>
    </li>
</ul>

some.component.ts

openReport(id): void {
    this.router.navigate(['/app/main/sale/viewer', id]);
}

当您在浏览器中导航至销售查看器页面时,该按钮仍会显示,并且我不确定如何在单击该按钮后将其删除。有人有想法吗?

0 个答案:

没有答案