Why the function from my child component is called four times?

I have parent component and child component. I know that change detection runs on events' http request, setInterval or setTimeOut etc. But here i don't have any of this and on initial loading of my parent component i get called the function with name - calledChildCompo four times in my child component. So i get in the console four times child compo is called on initial loading. Why is the change detector runed four times on initial loading when i don't have events http request or any interval in my code ?

//parent compo

<app-child-compo></app-child-compo>


// child compo html


{{ calledChildCompo() }}


// child compo ts

calledChildCompo() {
    console.log('child compo is called');
  }


Read more here: https://stackoverflow.com/questions/64404358/why-the-function-from-my-child-component-is-called-four-times

Content Attribution

This content was originally published by sdsd at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: