yuyang041060120 / ng2-validation

angular2 validation
https://yuyang041060120.github.io/ng2-validation/index.html
MIT License
612 stars 213 forks source link

equalTo do not work in case the two inputs are not at the same structure #105

Open dev-mfm opened 7 years ago

dev-mfm commented 7 years ago

In case the below code the [equalTo] do not work

                        <div class="col-md-6">
                            <label for="pass" class="control-label "> كلمة المرور <span class="required">*</span> </label>
                            <input type="password" class="form-control" required id="pass" #pass="ngModel" [(ngModel)]="editTenant?.adminUser.password" name="pass">
                            <span *ngIf="pass.errors?.required && pass.touched" class="required">يجب إدخال كلمة المرور</span>
                        </div>
                        <div class="col-md-6">
                            <label for="passconf" class="control-label"> تأكيد كلمة المرور<span class="required">*</span></label>
                            <input type="password" class="form-control" id="passconf" #passconf="ngModel" [(ngModel)]="passwordConfirm" name="passconf" [equalTo]="pass">
                            <span *ngIf="passconf.dirty && passconf.errors?.equalTo" class="required"> كلمة المرور لا تطابق تأكيد كلمة المرور </span>
                        </div>

I have to wrap the above code with something like this

<div class="form-group">
.........
</div>