How To Improve Angular Application Performance
  • Reads 1
  • Votes 0
  • Parts 1
  • Time <5 mins
  • Reads 1
  • Votes 0
  • Parts 1
  • Time <5 mins
Ongoing, First published Mar 21, 2024
1. In ngFor loops, use trackBy

To iterate over a set of data and render a template for each item, utilise the ngFor directive. Performance issues could arise, though, if the collection is big.

You can track changes to the collection using the trackBy attribute to enhance performance. By doing this, Angular won't have to render the whole template again for every item in the collection.



2. Make Use of Lazy Loading

Using the lazy loading strategy, you can load only the components that are actually needed at that particular moment. By decreasing the size of the initial bundle that the browser downloads, this can aid in performance improvement.

Each component that is lazily-loaded needs to have its own module in order to use lazy loading. When the component is required, you can utilise the router to load the module.
All Rights Reserved
Sign up to add How To Improve Angular Application Performance to your library and receive updates
or
#14webapplicationdevelopment
Content Guidelines
You may also like
Slide 1 of 1
Sex and Death in Skeleton City cover

Sex and Death in Skeleton City

29 parts Complete

Geoff and Naomi are dead, and they're depressed, but when Geoff's cat Bernie dies as well, they embark on a wild journey to find it in the underworld. ***** When Geoff dies, alongside his girlfriend Naomi, they end up sharing an apartment in the Underworld as skeletons. But after a few years, Geoff starts suffering a mid-death crisis. What's the purpose of going through the motions as a skeleton if you can't really live? Then he gets word that his cat, Bernie, just died and he can collect him and bring him home! Geoff and Naomi hurry to get Bernie only to discover that, due to a clerical error, their cat has been lost. With the hunt for Bernie giving new purpose to Geoff's un-life, he and Naomi begin a quest to get back their cat. Battling skeleton pirates, climbing the sky ladder and facing off against the villain who took Bernie, Geoff is determined to find his purpose - or die a second time trying! [[2018 Wattys Winner - The Originals]] [[word count: 30,000-40,000 words]]