Enhancing the performance of Angular applications
Understanding how Angular change detection works using the OnPush
change detection strategy on as many components as possible and using Signals to further improve the change detection is a good first step to building a performant application. However, the framework has more to offer when developing performant applications.
In this section, we will explore the built-in tools and learn tips you can use to enhance the performance of your Angular applications and ensure swift page loads and good runtime performance. The first built-in tool to enhance performance that we will explore is the runOutsideAngular()
method.
Understanding and using the runOutsideAngular() method
In Angular applications, optimizing performance sometimes involves executing specific tasks outside the Angular Zone. In the previous section, you learned about Zone.js, how Angular uses it to create the NgZone, and how it relates to change detection and the update...