I have a form in which there are 2 date fields, from date
and todate
. I am writing a directive to compare this date field.
How to take the from date filed.I am invoking my custom directive on the onBlur
of toDate
and now need to take fromdate.The form design is as fillows.
<div class="row">
<div class="col-xs-6 col-sm-6 col-6">
<label>From date</label>
<input type="text" id="eduFromDate" name="eduFromDate" class="form-control"
ng-model="education.fromDate" ui-date/>
</div>
<div class="col-xs-6 col-sm-6 col-6">
<label>To date</label>
<input type="text" name="edutoDate" class="form-control" id="edutoDate"
ng-model="education.toDate" ui-date before-date/>
<span class="error input-icon fui-alert"
ng-show="historyForm.edutoDate.$error.beforeDate"></span>
</div>
</div>