view raw
Michał Szydłowski Michał Szydłowski - 11 months ago 37
Javascript Question

How to use the bootstrap datepicker?

I'm fairly new to Angular.js (or to web programming in general). I got a pretty basic problem - I'd like to include a date picker in my application. For this purpose, I try to set up the bootstrap datepicker:

I have the jQuery and Bootstrap dependencies included:

<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="css/blog.css">
<script src="angular-datepicker.js"></script>
<script src=""></script>
<script src=""></script>
<script type="text/javascript" src=""></script>
<script src=""></script>
<script type="text/javascript" src="js/blogController.js"></script>

I don't really understand, how am I supposed to use it from now on? I can include some input field in my HTML template, but how exactly do I call the script that calls the date picker widget?


Add an id or a class to your input field and use that as a selector once you call the datepicker.

In your HTML:

<input type="text" class="datepicker">

In your JS: