I’m trying to get ngCordova datepicker working and I’m having difficulty getting it to display when I click the input field. The simulator just shows the keyboard for a text input.
Here is my View
<label class="item item-input item-stacked-label">
<span class="input-label">Start Time</span>
<input type="text" ng-model="data.startDateTime" ng-click="datePicker()">
</label>
Here is my controller
$scope.datePicker = function(){
var options = {
date: new Date(),
mode: 'date', // or 'date'
minDate: new Date(),
allowOldDates: true,
allowFutureDates: true,
doneButtonLabel: 'DONE',
doneButtonColor: '#F2F3F4',
cancelButtonLabel: 'CANCEL',
cancelButtonColor: '#000000'
};
document.addEventListener("deviceready", function () {
$cordovaDatePicker.show(options).then(function(date){
alert(date);
});
}, false);
}
I have added $cordovaDatePicker as a dependecy to my controller as well. There are no errors inside of js console web looking at in the browser. I am unable to see it in the emulator as well as in Ionic View