I'm using trying to use the following datepicker in my Angular 5 project but I'm not sure how to import it:-
https://bootstrap-datepicker.readthedocs.io/en/latest/index.html#
I'm using Angular CLI to build my project and I've added the bootstrap-datepicker.min.js file into my scripts section in my angular-cli.json file:-
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/popper.js/dist/umd/popper.js",
"../node_modules/bootstrap/dist/js/bootstrap.js",
"../js/custom.js",
"../js/bootstrap-datepicker.min.js"
]
And I've also imported JQuery into my Angular component:-
import * as $ from 'jquery';
..which does work as I can reference the $ object in my component and get a handle to a load of JQuery functions. However, when I do something like:-
$("dateField").datepicker()
It tells me the function is not available on the JQuery object. Does anyone have any ideas how to use this in Angular?
Thanks,
Adam