I have a template driven form with two date inputs. The second one needs to be after the first one. I found some examples for creating custom validators but these approaches seem to be very complex and I don't think that something is necessary for this little problem and also this approach does not allow to validate two inputs interdependently.
<form #contractForm="ngForm">
<md-input-container>
<input type="date" mdInput name="validFrom">
</md-input-container>
<md-input-container>
<input type="date" mdInput name="validUntil">
</md-input-container>
</form>
I just thought about something like this
<input type="date" mdInput name="validUntil" [valid]="validFrom.value < validUntil.value">
You know a simple way to check this?