Angular Change Detection and List Link

Does Angular matter if in each digest cycle I return a new list with the same contents or return the same list instance? This involves detecting changes by default, not OnPush.

+5
source share
1 answer

He will have some influence - ngFor will need to reevaluate each of the elements - he will check the identification. This should be quick, but if you have thousands of items in a large application, this can add some overhead, so if you can better return the same list every time.

+1
source

Source: https://habr.com/ru/post/1266714/


All Articles