Hi Im trying to do this in an html template in angular. It shows the icon I want, but the function gets called like much to often... what am I missing here? Template
<li class="pet-list__entry" *ngFor="let pet of listOfPets">
<div class="pet-list__entry__image-segment">
<fa-icon [icon]=getIcon(pet.type)></fa-icon>
</div>
<div class="pet-list__entry__data-segment">
{{ pet.name }}
</div>
</li>
getIcon(id: string): string {
const iconName = this[id];
console.log(iconName);
return iconName;
}
