I have a div element that is looped through an array of objects using *ngFor. The height of a particular div is different from each other as each object contains different amoun
You can use ViewChildren to get the elements, and in ngAfterViewInit, get the size
{{food.title}}
{{food.ingredients}}
@ViewChildren('foodcard') foodCards:QueryList
ngAfterViewInit()
{
let maxHeight=0
this.foodCards.forEach(x=>{
const height=x.nativeElement.getBoundingClientRect().height
if (heigth>maxHeight)
maxHeight=height
})
}
Anyway, if your aim is set the same height check card-deck