4 ms·
I've been using Angular for a few months now and it's mostly been a good experience. We've been using Angular 7. My biggest gripe, and this might just be my in
by bpye 7y ago
I've been using Angular for a few months now and it's mostly been a good experience. We've been using Angular 7.
My biggest gripe, and this might just be my inexperience, is fighting the change detector to try and ensure reasonable performance when displaying a large number of elements. There are certainly mechanisms to do this but it does seem to take some work.
- jamesgeck0 7y agoFWIW, the Angular team is aware that this is a pain point. There were several talks at NG-Conf a few weeks ago that referenced replacing or removing zone.js-powered change detection for increased performance and/or smaller build sizes. They're trying to avoid another Angular 2 situation though, so it may take a while for a backwards compatible solution to surface as the default.
- nicoburns 7y agoThis is precisely what I don't like about Angular. That there is all this stuff. And I have to care about what it is doing under the hood (and this is complicated and not especially well documented). In React if I have performance issues, then it's pretty easy to work out what's causing them.
- jamesgeck0 7y agoYou can largely ignore what Angular is doing under the hood, tbh. If you're having performance issues, the answer is often related to change detection (aka, Zone.js).
- nicoburns 7y ago> If you're having performance issues, the answer is often related to change detection (aka, Zone.js). This is part of Angular really. At least it's not optional to use it. Change detection issues are not fun to debug!
- jamesgeck0 7y ago> At least it's not optional to use it. Zone.js is optional, although it is on by default. It's considered best practice to remove it when building standalone components with Angular Elements.
- ajryan 7y agoYou should be using OnPush everywhere, then your struggle will change to only getting changes detected in certain scenarios. Still a pain sometimes but not as bad as the Default change detection strategy.
- jinder 7y agoSwitch to OnPush, use async pipes and immutable data structures. Add to that some of the virtualization components that ship with @angular/cdk and you're pretty golden most of the time.
- equasar 7y agowhat's your use case to display a large number of elements in the same page? Curious.
- paweldz 7y agolike lists with thousands of elements? OnPush change detection and virtual scrolling - https://material.angular.io/cdk/scrolling/overview https://material.angular.io/cdk/scrolling/overview