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 <
You will need to add a dropdown directive in order for this to work. The directive looks like this:
import { Directive,HostListener,HostBinding } from '@angular/core';
@Directive({
selector: '[appcustomdropdown]'
})
export class CustomdropdownDirective {
constructor() { }
@HostBinding('class.open') get opened()
{
return this.isOpen;
}
@HostListener('click') open()
{
this.isOpen=true;
}
@HostListener('mouseleave') close()
{
this.isOpen=false;
}
private isOpen=false;
}
Then, you will add the attribute like so: