Signal queries in Angular – what can I do with them?

Loading

Reading Time: 5 minutesIntroduction In this blog post, I would like to show a new feature in Angular 17.2 that is called signal queries. This new feature allows Angular engineers to use viewChild, viewChildren, contentChild, and contentChildren to obtain the value as a signal. In my demos, I would like to apply these signal queries on a template-driven … Read more

Too many ViewChild? Try ViewChildren to query DOM elements

Loading

Reading Time: 3 minutesIntroduction This post describes how to refactor component to use ViewChildren to query DOM elements. It is a common case when inline template has several elements of the same type and the component uses ViewChild to query them. When this pattern occurs, we can consider to render the elements using ngFor and applying ViewChildren to … Read more