ng-bootstrap ngbdropdown放置不适用于角度4.3.5

时间:2017-08-24 22:46:28

标签: ng-bootstrap

展示位置不适用于“右上角”。只是转到默认值。

我的包裹:

“@ ng-bootstrap / ng-bootstrap”:“^ 1.0.0-beta.1”,    “bootstrap”:“^ 4.0.0-beta”,

<div ngbDropdown placement="top-right" class="d-inline-block">
                <button class="btn btn-outline-primary" id="dropdownBasic2" ngbDropdownToggle>Auto Fill Queue From
                    Library
                </button>
                <div ngbDropdownMenu aria-labelledby="dropdownBasic2">
                    <button class="dropdown-item" (click)="rebuild(3)">4 More Days</button>
                    <button class="dropdown-item" (click)="rebuild(3)">3 More Days</button>
                    <button class="dropdown-item" (click)="rebuild(2)">2 More Days</button>
                    <button class="dropdown-item" (click)="rebuild(1)">Through Tomorrow</button>
                    <button class="dropdown-item" (click)="rebuild(0)">Rest of Today</button>
                </div>

            </div>

1 个答案:

答案 0 :(得分:2)

ng-bootstrap dropdownsplacement选项仅在ng-bootstrap 1.0.0-beta.2中添加,因此您需要更新ng-bootstrap的版本。更多信息可以在CHANGELOG

中找到

随着版本的更新,它可以完美地运行,您可以在此处进行验证:http://plnkr.co/edit/jZIt2YDWdqUOxCESig41?p=preview