I am calling a runtime function in html to get values from API service call, but the issue her is the function is getting called multiple times. Here's the sample code for better understanding:
HTML:
<html>
<body>
.....
{{myfunction()}}
.....
</body>
</html>
Typescript:
import....
export class ..... {
myfunction(num) {
console.log("Sample value...");
}
}
I can see console message more than once on loading the page into browser. What is causing this and what is the solution where the function should executes only once in HTML? Appreciate your help.