Form validation by comparing dates angularjs
<p>Is there any simple way to leave submit button disabled even when datefrom is bigger than dateto? and it has to be disabled until form is valid, with valid dates, datefrom must be less than dateto</p>

<pre><code>&lt;div class="form-group"&gt;
        &lt;div class="col-lg-4 col-md-4 col-sm-5 col-xs-5 col-lg-offset-1 col-md-offset-2 col-sm-offset-1"&gt;
            &lt;label class="control-label"&gt;Date from:&lt;/label&gt;
            &lt;p class="input-group"&gt;
             &lt;input type="text" onkeypress='return event.charCode &gt;= 44 &amp;&amp; event.charCode &lt;= 57' class="form-control" ng-model="recp.OdK" name="datefrom" id="datefrom" data-date-format="dd.MM.yyyy" bs-datepicker data-autoclose="1" required/&gt;
            &lt;span class="input-group-btn"&gt;
                                &lt;button type="button" class="btn btn-default" ng-click="Opened=true;$event.stopPropagation();"&gt;
                                    &lt;i class="glyphicon glyphicon-calendar"&gt;&lt;/i&gt;
                                &lt;/button&gt;
                            &lt;/span&gt;
                            &lt;p&gt;
        &lt;/div&gt;

        &lt;div class="col-lg-4 col-md-4 col-sm-5 col-xs-5"&gt;
            &lt;label class="control-label"&gt;Date to:&lt;/label&gt;
            &lt;p class="input-group"&gt; 
            &lt;input type="text" onkeypress='return event.charCode &gt;= 44 &amp;&amp; event.charCode &lt;= 57' class="form-control" ng-model="recp.DoK" name="dateto" id="dateto" data-date-format="dd.MM.yyyy" bs-datepicker data-autoclose="1" required/&gt;
            &lt;span class="input-group-btn"&gt;
            &lt;button type="button" class="btn btn-default" ng-click="Opened1=true;$event.stopPropagation();"&gt;
                                    &lt;i class="glyphicon glyphicon-calendar"&gt;&lt;/i&gt;
                                &lt;/button&gt;
                              &lt;/span&gt;
                            &lt;/p&gt;
        &lt;/div&gt;
    &lt;div class="col-lg-1 col-md-1 col-sm-1 col-xs-1"&gt;
      &lt;button type="submit" ng-disabled="recpForm.$invalid" id="buto" class="btn btn-primary glyphicon glyphicon-ok prikButton" ng-click="precp();precpnp();precprb();recpss();"&gt;&lt;/button&gt;
    &lt;/div&gt;
</code></pre>