Can someone help me figure out what's going on here? Recently, I set up a new Angular project and in app.component.html, I have the following code:
<img [src]="getDemoImg()">
In app.component.ts:
getDemoImg(){
console.log('why so many logs???');
return 'https://historia.nationalgeographic.com.es/medio/2019/12/11/coliseo-roma_2924b6ae_1280x720.jpg'
}
The issue is that the console.log message is appearing four times, indicating that the function is being called repeatedly. Any insights into what could be causing this?
Here is a link to a reproducible example: https://stackblitz.com/edit/angular-ivy-d5hdmo?file=src%2Fapp%2Fapp.component.html