How often is the code in * ngIf state in Angular 2+ mode?

I'm wondering how * ngif works:

<img *ngif="isMediaMessage(message) === 'audio'" src="assets/img/audio1" />

      

1) When I put the console inside a function isMediaMessage

, the console prints infinitely; I wonder why this is so. Is it because of the digest cycle? dirty check? I am reading more about this.

2) Should I use less data binding if I want to reduce the render time?

3) Could you tell me this article is being updated?

It could be related.

+3


source to share


1 answer


This refers to the acquisition / acquisition cycle and the hours per page.



Every time a page change occurs and a dirty checkout queue is executed, the detection engine is running, will re-evaluate the ngIf and your ngIf code / condition will fire.

+4


source







All Articles