title: Validate that end date is greater than start date with angularjs
body: <p>How do I check/validate in angularjs when click on save button whether end date [textbox] is greater than start date [textbox]?</p>
  
  <pre><code>    &lt;form name="myform" class="form-horizontal" role="form" novalidate&gt;
  
                  &lt;div class="row form-group  "&gt;
                      &lt;div class="col-md-3 col-md-offset-2  "&gt;
                          &lt;label class="control-label"&gt;From&lt;/label&gt;
                          &lt;i id="validationMark"&gt;*&lt;/i&gt;
  
                          &lt;input type="date" id="startDate" name="From" ng-model="empModel.from" class="form-control" ng-model-options="{timezone: 'utc'}" /&gt;
                          &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
                      &lt;/div&gt;
                      &lt;div class="col-md-3 "&gt;
                          &lt;label class="control-label"&gt;To&lt;/label&gt;
                          &lt;i id="validationMark"&gt;*&lt;/i&gt;
  
                          &lt;input type="date" id="endDate" name="To" ng-model="empModel.to" 
                                 class="form-control" ng-model-options="{timezone: 'utc'}"  /&gt;
                          &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
                          &lt;span&gt;{{errMessage}}&lt;/span&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
  
       &lt;button type="button" value="Save" ng-disabled="isDisabledsave"  
               ng-click="myform.$valid &amp;&amp; saveCustomer() " id="btnsave" 
               class="btn btn-primary next-step"&gt;Save&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>save button shouldn't call <code>saveCustomer()</code> function if <code>endDate</code> [textbox] is less than <code>startDate</code> [textbox]</p>