Quantcast
Channel: Telerik Blogs
Viewing all articles
Browse latest Browse all 5210

Blazing Fast List Rendering in Angular

$
0
0

Understand how NgFor works in Angular, and how it can be further customized to squeeze out an additional 30-50% improvement to your rendering performance.

Angular has a clever way to control the template structure of a component; through structure directives like NgIf, NgForOf, and NgSwitch. In this post, we will concentrate on NgForOf, because - despite some of its disadvantages - it is the mainstream way of rendering an iterable.

How Does NgForOf Work?

The documentation states:

The NgForOf directive instantiates a template once per item from an iterable. The context for each instantiated template inherits from the outer context with the given loop variable set to the current item from the iterable.

Each template instance will be created with an implicit context bound to each data item. This is done in the applyChanges method. The most interesting part is the result of the IterableDiffer instance, which determines whether a new template instance should be created, removed or… (Continue reading at telerik.com)


Viewing all articles
Browse latest Browse all 5210

Trending Articles