brushleaf
brushleaf

Reputation: 1215

How can one clear the date on AngularStrap's (Bootstrap) bs-datepicker?

Referring to this directive for AngularJS, which wraps Bootstrap's datepicker: http://mgcrea.github.io/angular-strap/#/datepicker

I'm unable to find a way to clear the control programmatically once it's been set. I have tried setting it to null and empty string, neither work.

Upvotes: 0

Views: 9504

Answers (1)

Maxim Shoustin
Maxim Shoustin

Reputation: 77904

Just add to controller:

$scope.clickMe = function(){  
   $scope.datepicker = null;
 };

It will clear date input.

see Plunker

Upvotes: 2

Related Questions