IMHO, showing the current time for empty values, is a switch for this component. I can not imagine why it has not yet been fixed.
However, there is an idea how to unobtrusively get around this problem.
Disclaimer: the use of the following directive has its drawbacks, and this is not the most pleasant solution, but it is a hack and in order for it to be hacked, it works very well.
app.directive('inputEmpty', function () {
return {
restrict: 'A',
link: function link(scope, element, attributes) {
setTimeout(function () {
var inputs = element.find('input');
inputs.val('');
scope.$watch(attributes.inputEmpty, function (val) {
if (!val) { inputs.val('').change(); }
});
});
}
};
})
Here is a usage example:
<uib-timepicker ng-change="change()" hour-step="1" minute-step="15" show-meridian="true"
ng-model="value"
input-empty="value"
></uib-timepicker>
source
share