In the parent component known as Property-page.component.html, I am looping through a variable called propertiesArray
and trying to display a list of property-card
components based on it.
<property-card
*ngFor="let propertiesItem of propertiesArray"
[propertiesItem] = "propertiesItem"
></property-card>
Property-card.component.ts:
export class PropertyCardComponent implements OnInit {
@Input() propertiesItem: any;
constructor() {}
ngOnInit() {}
}
Property-card.component.html:
<div class="upload-card-content">
<mat-card-header>
<mat-card-title>{{ propertiesItem.id }}</mat-card-title>
</mat-card-header>
<mat-card-content>{{ propertiesItem.designation }}</mat-card-content>
<mat-card-footer>
<span class="icon-icon_calendar"></span>
Period:
<span class="period">{{ propertiesItem.period }}</span>
</mat-card-footer>
</div>
Question
I'm facing an issue where the propertiesItem
in the child component is coming up as undefined
. Can someone help me figure out what I might be overlooking?