How is the best way to use a bootstrap plugin like Eonasdan/bootstrap-datetimepicker in Angular2?
I use jspm in my setup and have installed Eonasdan/bootstrap-datetimepicker. The I include the javascript in my Component:
import { datepicker } from 'Eonasdan/bootstrap-datetimepicker';
In AfterViewInit I have tried to add the .datetimepicker() to the html element like this:
ngAfterViewInit() {
var elm = <HTMLDivElement>document.getElementById('datetimepicker1');
elm.datetimepicker();
}
But this is not working. How can I solve this issue?