Hey fellow tech enthusiasts, I'm currently dealing with a complex nested JSON object retrieved from an API. Here's a snippet of the object:
profile : {
title:"Mr",
personalInfo:{
fullNames: "John Doe",
id: "569"
}
Address:{
line1:"addd one",
line2:"addd two"
}
}
As for my HTML component:
<ion-input placeholder="Full Names" [(ngModel)]="profile.personalInfo.fullNames" ></ion-input>
Upon compiling the code, I encountered an error message stating
TypeError: Cannot read property 'personalInfo' of undefined
Interestingly, when I access the non-nested title property in my HTML component, everything works fine.
Any insights on how to tackle this issue?