This is how i assigned my model in a variable in my component. Here i want to fetch data by calling familyHistoryModel.patientMedicalFamilyHistoryDiseases.diseaseID but this gets error unable to call diseaseID like that is there any alternative way to access diseaseID data by calling familyHistoryModel.patientMedicalFamilyHistoryDiseases.required code to fetch diseaseId data
export class FamilyHistoryModelComponent implements OnInit {
familyHistoryModel: PatientMedicalFamilyHistoryModels;
below code is my model.
export class PatientMedicalFamilyHistoryModels {
id?: number = 0;
patientID: number = null;
firstName: string = '';
lastName: string = '';
genderID: number;
gender: string = '';
dob: Date;
relationshipID: number;
relationShipName: string = '';
dateOfDeath: Date;
causeOfDeath: string = '';
observation: string = '';
patientMedicalFamilyHistoryDiseases?: PatientMedicalFamilyHistoryDiseaseModel[];
}
export class PatientMedicalFamilyHistoryDiseaseModel {
id?: number = null;
patientID?: number = null;
medicalFamilyHistoryId?: number = null;
diseaseID?: number = null;
diseaseStatus?: boolean = false;
ageOfDiagnosis?: number = null;
diseaseName?: string =null;
}