父组件
<app-hct-patient-page-eligibility [patientProfileSurvey]="patientProfileSurvey" [plaquePsoriasisSurvey]="plaquePsoriasisSurvey"></app-hct-patient-page-eligibility>
子组件
@Input() patientProfileSurvey:any; ngOnChanges(changes:SimpleChanges){ //get patientProfileDatas if(changes["patientProfileSurvey"]!=undefined){ if(changes["patientProfileSurvey"].currentValue.length){ changes["patientProfileSurvey"].currentValue=changes["patientProfileSurvey"].currentValue.sort((a, b) => b.scheduledDateTime.localeCompare(a.scheduledDateTime)) //get the latest data this.profileSurveyArray=changes["patientProfileSurvey"].currentValue[0]; this.profileSurveyArray=this.profileSurveyArray["surveyQuestionsResponses"].filter(element=>element["externalQuestionID"]=="37034") this.criteriaDatas=this.criteriaDatas.concat(this.profileSurveyArray) } } }