Categories
Uncategorized

Simple Date Picker using AngularJS Directives

Download this file. Extract it’s contents onto your web root folder (or your directory). Open the directory in a web browser and you will see something similar to this.

Birth Date Form

To use this directive (Angular’s very own HTML 5 web components), you can use the following HTML tag in any forms after initializing the Angular Application.

Few browsers do not handle the self closing tags all that well, so using the following syntax might help in that case.

Also make sure you include the following lines anywhere on the page where you want to use the date picker. Note that it is not necessary to include the Javascript files before you use the date tag, it works even if the code is loaded after the contact tag is loaded. Bootstrap 3 is also being used to render the UI, so it has to be included before the tag is placed in the web page.

Demo

Usage: