Can you please guide me on how to implement the bootstrap datepicker in an AngularJS application? I have two fields - name and date. I would like the datepicker to appear when the user clicks on the date field. Here is a snippet of my code: http://plnkr.co/edit/elrOTfEOMmUkPYGmKTdW?p=preview
var app = angular.module('plunker', ['angularMoment']);
app.controller('MainCtrl', function($scope, moment) {
$scope.name = 'World';
console.log(moment)
var d = new Date(613938600000);
$scope.c = {
name: {
name: 'abc'
},
date: {
name: moment(d).format('DD-MMM-YYYY')
}
};
$scope.onclick = function() {
if (!moment($scope.c.date.name).isValid()) {
alert('Something seems off');
} else {
alert('Everything looks good');
}
}
});
Any suggestions for updates?