Here's the scenario... I'm using AngularJS and I need to do some modifications to the Datetimepicker extension without modifying the core files or use other extensions.
Anyway, all I needed to do was to clear the timepicker by means of a function (maybe?). The original Timepicker this extension is based upon seems to allow clearance of the time.
Here's my first attempt: plunkr
Here's the function:
$scope.clearPicker = function() {
$scope.date = null;
$scope.date.setHours(0); // Trying to clear the Timepicker
};
Another attempt is to resort to jQuery: plunkr2
Here's the function:
$scope.clearPicker = function() {
$scope.date = null;
angular.element(document.getElementsByClassName('datetimepicker-wrapper'))
.find('input')
.val('');
};
But of course many would say that the latter is not the Angular way.
So how should I go about injecting functions into an extension?