2024-11-12
6028
#angular
Lewis Cianci
192812
109
Nov 12, 2024 ⋅ 21 min read

Working with the Angular tree

Lewis Cianci I'm a passionate mobile-first developer, and I've been making apps with Flutter since it first released. I also use ASP.NET 5 for web. Given the chance, I'll talk to you for far too long about why I love Flutter so much.

Recent posts:

React.memo explained: When to use it (and when not to)

React.memo prevents unnecessary re-renders and improves performance in React applications. Discover when to use it, when to avoid it, and how it compares to useMemo and useCallback.

Emmanuel John
Feb 26, 2025 ⋅ 9 min read
React useCallback: When And How To Use It For Better Performance

React useCallback: When and how to use it for better performance

Learn how React’s useCallback hook boosts performance by memoizing functions and preventing unnecessary re-renders with practical examples and best practices.

Emmanuel John
Feb 26, 2025 ⋅ 6 min read
what is the virtual DOM in react

What is the virtual DOM in React?

Learn the characteristics of the virtual document object model (DOM), explore its benefits in React, and review a practical example.

Ibadehin Mojeed
Feb 26, 2025 ⋅ 9 min read

A practical guide to switch statements in JavaScript

You might start with if...else statements. But as your logic grows more complex, you’ll discover the switch statement in JavaScript is simply better for handling multiple conditions in a clean and readable way.

Fimber Elemuwa
Feb 26, 2025 ⋅ 6 min read
View all posts

2 Replies to "Working with the Angular tree"

  1. treeControl is deprecated, use one of `levelAccessor` or `childrenAccessor` instead. To be removed in a future version.

  2. The flat tree has performance benefits. Your example was just not suited for it . Ideally you want to render the entire tree at once, and not load it every time you expand a node. But wait, if you use a nested tree and give the entire tree at once, you can have performance issues. That is the point of the flat tree. Where nested tree struggles, flat tree comes to the rescue. It’s easier for the DOM to render one level when the number of elements is high.

Leave a Reply