I have followed the following to install bootstrap 4 into my Angular 2 project: Accepted Answer, following the first 1,2,3 and 4 steps
However when I add the following <
i have used a different approach for getting drop down on collpased navbar.
STEP 1 Add click event on navbar toggle button
Html
Step2: implement the function inside Navbar component.ts (Above navbar html template is used inside navbar component)
import { Component} from '@angular/core';
export class HeaderComponent {
buttontoggled:boolean:false;
OnClik(){
this.buttontoggled=!this.buttontoggled;
}
Step 3
based on the navbar toggle button click add class show(bootstrap 4) or open
for previous bootstrap versions.
we can use ngClass Directive for this