This is the second part of this series, and this blog post is about how we can speed up the reloading of an Angular application. In future posts, we’ll talk about how to profile your running application, and how to improve runtime performances.
ngFor is a directive that iterates through a list of data and instantiates a template for each item in the list. It does an amazing job when dealing with small list. The issue with ngFor is that it loads everything on DOM, which is slow – possibly iterating over hundreds of items and rendering them. This can impact the performance negatively by hogging memory and processing power. On top of that, any change to a single item on the list, the whole list is re-rendered.
In this short article, we’re going to explore secondary outlets (sometimes called named router outlets) and see the role they play in routing. By the end of this article, you will understand; how to define secondary outlets, why secondary outlets are used, the effect that they have on the structure of a URL and how they are routed and activated.