In ng-bootstrap NgbDropdown, how would you display the text of the selected button so that what ever item the user selects replaces the default text initially shown?
Demonstrated in this plunkr.
Example Component:
import {Component} from '@angular/core';
@Component({
selector: 'dropdown-demo-sortby',
template: `
`
})
export class DropdownDemoSortby {
sortOrders: string[] = ["Year", "Title", "Author"];
selectedSortOrder: string = "Sort by...";
ChangeSortOrder(newSortOrder: string) {
this.selectedSortOrder = newSortOrder;
}
}