angular2 ng-bootstrap drop down dropdown component
Can some one help me to find out how can i bind angular2 component with dropdown and call open or close method..
they don't have much documentation.
You can use ViewChild decorator. In parent component it should look something like that:
import 'ViewChild' from '@angular/core'
import 'NgbDropdown' from '...';
[...]
export class ParentComponent {
@ViewChild(NgbDropdown)
private dropdown: NgbDropdown;
closeDropdown() {
this.dropdown.close();
}
}
You can read more about ViewChild in official documentation: Component Interaction | ViewChild.