0

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 ?

Krzysztof Safjanowski
  • 7,124
  • 3
  • 33
  • 47
Bishnu Bhattarai
  • 2,662
  • 7
  • 34
  • 43

0 Answers0