Problem: Calling multiple times when using angular directive. My transaction results are not correct. Multiple entries are entered on the Console screen.
I want to: Let the function execute only once.
Example code written
in HTML page
<div *ngIf="TEST(0)"> </div>
in .ts Page
TEST(number) {
console.log (number);
}
Result:
2 2 2 2
I did a very simple example on the stackbilitz website.
Here is the link;
StackBlitz Link
Is this an angular bug? Or is there something different I haven't considered?
Thank you in advance for all your answers.