i'm using ng-bootstrap and i want to get the value of dropdown when selected .
<div class="col text-right">
<div ngbDropdown placement="top-right" class="d-inline-block">
<button class="btn btn-outline-primary" id="dropdownBasic2" ngbDropdownToggle>Toggle dropup</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic2">
<button class="dropdown-item">Action - 1</button>
<button class="dropdown-item">Another Action</button>
<button class="dropdown-item">Something else is here</button>
</div>
</div>
You need to add a click event:
<button class="dropdown-item" (click)="changeAction(obj)">
In the component:
changeAction(obj) {
//your logic here
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With