If I use Map.get(‘key1’) in angular template, does the change detection mechanism check the map value every cycle?

  Kiến thức lập trình

I know it is not a good practice to call expressions from a template in angular, because angular cannot predict whether the return value of a function has changed, so it needs to execute the function every time change detection runs.

My question is if angular will do the same behaviour for Map.get(‘key1’) -> will it check the value of the map every change detection cycle, or no?

Also, any idea on how I can test this myself?

<ng-container *ngIf="myMap.get('key1')">....

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT