I am making a custom directive for datetimepicker
in Angular. But the $scope.start_date
does not contain the value that is displayed in the input datetimepicker. I have tried using $apply
.
campaign.directive('datetimepicker', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, element, attrs, ngModelCtrl) {
element.datetimepicker({
format: 'YYYY-MM-DD HH:mm'
});
}
}
});
Can anyone help me ?