I've a Angular application which displays company & contact person information on a text box as below Company Email address:
<label> Company Email address</label>
<input type="text" class="form-control" [(ngModel)]="companyInfo.contactInfo.email" value="{{ companyInfo?.contactInfo?.email }}">
&&& Contact Person Email address:
<label>Contact Email address</label>
<input type="email" class="form-control" [(ngModel)]="companyInfo.contactPerson.contactInfo.email" value="{{ companyInfo?.contactPerson?.contactInfo?.email }}">
since this info is obtained from a nested object, when the email address of the company is typed in, it reflects in the contact's email address as well. Anything I'm overlooking as component assignment works fine but when input is typed in, it gets mirrored?
Hi i got your question it is due to two way binding
ngModelis 2-way data binding but it seems the values seems different in this case please check proper names or if possible write your problem in stackblitz.Or there is another way for it, assign 2 variables in .ts class and reflect the names like this.