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,292
  • 3
  • 35
  • 47
Bishnu Bhattarai
  • 2,800
  • 8
  • 36
  • 44

0 Answers0