What i want to realize is two input fields which i want to compare. If same, form has to be valid. Otherwise, invalid. This is the code:
<form name="form" class="css-form" novalidate>
E-mail: <input type="email" placeholder="student@university.com"
ng-model="user.email" name="uEmail" required/>
<span class="error" ng-show="form.uEmail.$error.email">
Not valid email!</span>
Repeat e-mail: <input type="email" placeholder="student@university.com"
ng-model="repEmail" required/>
<span ng-if="user.email != repEmail">
E-mail address are not same!
</span>
</form>
The problem is, although these fields are not same, it is true:
form.$valid == true
Thus, how can i change the validity of form so that it can be false if the input fields are not same (although they are valid e-mail addresses)