Upon using a custom component with an input property where a function is bound to it, I have observed that the function gets called multiple times.
For example:
<some-tag [random-input]="randomFunction()"></some-tag>
And in the class:
private randomFunction() {
console.log('Called!');
return true
}
Running a simple code snippet like this results in several 'Called!' logs appearing in the console. In my project, the randomFunction makes a call to the database, which can be quite bothersome.
Is there anyone who knows why this behavior occurs?