From the course: Reactivity and Signals in Angular

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

The benefits of using Angular Signals in components

The benefits of using Angular Signals in components - Angular Tutorial

From the course: Reactivity and Signals in Angular

The benefits of using Angular Signals in components

- Components are the building blocks of Angular applications, and so it is important to understand how signals affect them. Signals were added to Angular not only to improve performance, but also to improve the developer experience. Before we dig into how we use signals and components, we should understand why we want to use signals and components. From the user's perspective, the biggest reason is performance. We learned previously that Angular uses zone.js to trigger change detection cycles. Apps using default change detection have to run every single component in the tree. Any time something triggers change detection, it turns out change detection gets triggered a lot. We can detach components from the change detection tree by using OnPush. This allows Angular to only run change detection when it knows that it needs to check. The detached branch for changes signals allows us to take this optimization one step further. Before signals, the best practice for performance was to use the…

Contents