Angular ngAfterContentChecked triggering non stop

Discussão em 'Angular' iniciado por TurtleTread, Dezembro 6, 2024.

  1. TurtleTread

    TurtleTread Guest

    I'm logging ngAfterContentChecked event and see this function triggering 10+ times per second. Is this normal? or when should this event be triggered? What could possibly cause this non stop retrigger?

    Normally the UI frameworks only do change detection when there's a change in the data. How does Angular ngAfterContentChecked get triggered? Or generally when does Angular do the render / update checks?

    Edit:

    Could getter functions possibly be responsible for this? since they get evaluated and return a new value every time. But if they are only 'inputs' for children components, and they are not getting modified afterwards, they shouldn't cause the infinite triggers?

    Continue reading...

Compartilhe esta Página