I am working on a form ,I have two fields contact number and alternate contact number. My aim is if the value entered in alternate contact number matches with contact number then it should push.msg "please change number".I tried ngModel and onchange event but that dosen't seem to work.
html
<div class="ui-g-12 ui-md-6">
<div class="ui-g-12 ui-md-6 ui-md-nopad ui-g-nopad">Mobile Number<span style="color:red">*</span>
</div>
<div class="ui-g-12 ui-md-6 ui-md-nopad ui-g-nopad">
<p-inputMask mask="9999999999" placeholder="Contact No." formControlName='Proposercontact'>
</p-inputMask>
</div>
</div>
<div class="ui-g-12 ui-md-6">
<div class="ui-g-12 ui-md-6 ui-md-nopad ui-g-nopad">Alternate Contact no<span
style="color:red">*</span>
</div>
<div class="ui-g-12 ui-md-6 ui-md-nopad ui-g-nopad">
<p-inputMask mask="9999999999" placeholder="Contact No." formControlName='Proposercontact1'>
</p-inputMask>
</div>
</div>