title: How I restrict the user to only enter Date Field in angular bootstrap datepicker
body: <p>I am new in angular and I stuck at point where I am unable to restrict the user to enter valid date manually. It sets the date as undefined for empty, characters as well as invalid date entered by the user. The date format I have mentioned is MM-dd-yyyy. Even if I enter 85/34/2102 it assumes this as a date and takes some junk value instead of validating and throwing an error.</p>
  
  <p>my code of angular date-picker in html </p>
  
  <pre><code> &lt;input type="text" class="form-control" datepicker-popup="{{clCtrl.format}}" 
     ng-model="clCtrl.QualityExpirationDate" is-open="clCtrl.openedQualityDate" 
     min-date="clCtrl.minDate" datepicker-options="clCtrl.dateOptions"  
     ng-required="true" close-on-date-selection="true" show-button-bar="false" /&gt;
  </code></pre>
  
  <p>and code in angular controller side</p>
  
  <pre><code>self.dateOptions = {
          formatYear: 'yy',
          startingDay: 1
      };
  
      self.formats = ['MM-dd-yyyy', 'MM/dd/yyyy', 'MM.dd.yyyy', 'shortDate'];
      self.format = self.formats[0]; 
  
  self.openQualityDate = function ($event) {
          $event.preventDefault();
          $event.stopPropagation();
          self.openedQualityDate = true;
      };
  
  
   self.toggleMin = function () {
          self.minDate = self.minDate ? null : new Date();
      };
      self.toggleMin();
  
      self.clear = function () {
  
          self.QualityExpirationDate = null;
      };
  </code></pre>