0
votes

The verion of Angular-bootstrap i'm using is 0.14.2.

Issue: Though i set ng-model to "" or null it sets to currentDate. I want it to be empty. Cannot figure out what is the issue.

<input class="form-control" type="text"
       datepicker-append-to-body="true" uib-datepicker-popup="{{dateFormat}}"
       ng-model="businessJet.ExpirationDate"
       ng-change="info.updateRampFee(businessJet);"
       ng-click="businessJet.popupOpened = true"
       is-open="businessJet.popupOpened"
       ng-disabled="!businessJet.IsApplicable" />
1

1 Answers

0
votes

Setting the model to null will set the text to blank.

http://plnkr.co/edit/KjkZi814j36jAbEr3x3y

$scope.dateFormat = 'dd-MMMM-yyyy';

$scope.businessJet = {
    ExpirationDate:null,
    updateRampFee: function(dateObj) {
        console.log('date changed',dateObj)
    },
    popupOpened : false,
    IsApplicable : true
};

<input class="form-control" 
      type="text"
      datepicker-append-to-body="true" 
      uib-datepicker-popup="{{dateFormat}}"
      ng-model="businessJet.ExpirationDate"
      ng-change="businessJet.updateRampFee(businessJet);"
      ng-click="businessJet.popupOpened = true"
      is-open="businessJet.popupOpened"
      ng-disabled="!businessJet.IsApplicable" />