AngularM AngularM - 1 month ago 21
TypeScript Question

How to get jquery ui date picker working with angular2?

How to get jquery ui date picker working with angular2?

I'm using angular2 and typescript with html5.

I'm trying to add the jquery ui datepicker.

I have all the librarys and the css added but the datepicker jquery code is wiring up to the html.

lib: https://jqueryui.com/datepicker/

Heres my code:

<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>

<p>Date: <input type="text" id="datepicker"></p>


I've tried putting this in my component : $( "#datepicker" ).datepicker();
But I just get errors.

any ideas?

I get this error when I add the project to mine:

enter image description here

Answer

Well there are already many datepicker libraries available for the angular2. few of them i have posted below:

but yes obviously everyone need stylish datepicker for our project me too want same so i according to need i have created one datepicker using bootflat framework for styling. you can refer here..

https://github.com/MrPardeep/Angular2-DatePicker

hope this may help you !

enter image description here

Comments