-
Notifications
You must be signed in to change notification settings - Fork 419
Getting started
seibar edited this page Jan 7, 2015
·
2 revisions
There is currently no bower package, but you can point bower at the github endpoint:
bower install --save https://github.com/g00fy-/angular-datepicker.git
All of the javascript and templates are included in dist/index.js. Just add dist/index.js to your index.html:
<script src="bower_components/angular-datepicker/dist/index.js"></script>
Inject datePicker
into your angular app. For example:
angular.module('datePickerDemoApp', [
'ui.router',
'ui.bootstrap',
'datePicker'
])
Your controller might look something like this:
angular.module('datePickerDemoApp').controller('MainCtrl', function ($scope) {
$scope.selectedDate = new Date();
});
And here's an example of how you can use it in your view:
<div class="dropdown">
<a class="dropdown-toggle btn btn-danger">
Select a date: {{(selectedDate|date)}}
</a>
<div class="dropdown-menu" ng-click="$event.preventDefault();$event.stopPropagation()">
<div date-picker="selectedDate" min-view="date"></div>
</div>
</div>
There are several examples in the example app shipped with the code, under app/index.html. That will show you some other behavior/view options.