Why choose this name although now is September? Because Signals is the new feature of Angular 16, which is released on May 2023.
π We will talk about: Why, What, How, Where, When.
- Why do we need Signals?
- What is a Signals?
- How to create a Signals?
- When to use Signals?
- Where can we use signals?
π Mainly talk about signals and zone.js.
- We will clarify the question: βWill Signals lead to zone.js being optional?β.
- Drawbacks of zone.js: Angular depends on zone.js to trigger change detection. zoneJs will send a signal and notify Angular. As a result, Angular does not know where those events occur. Therefore, it need to run change detection from top to bottom in the component tree.
π Talk about change detection.
- Because Angular runs change detection from the top to bottom. That is the reason why we have OnPush.
- But OnPush Strategy also has its own drawbacks, too.
- As weβve known, OnPush change detection provides the possibility to skip unnecessary checks for the component and all its children components.
- But when we use detectChange() or markForCheck(), it breaks the rules.
- detectChanges runs change detection immediately from the current component down through its children.
- markForCheck marks current component and its parents up to the root as dirty for the next tick.
- But it should be only components that read an updated signal that will have to be change-detected.
- None of its parents and none of its children.
- One and only one component that needs to display changed data
- So, the question is: βAre we going to have another change detection strategy?β.
- βοΈ Thatβs a problem that Signals solves for us.
π Talk about signals and RxJS.
- Problems: 2 subscribers to 1 Observable.
- π€§ Old solution: using shareReplay()
- π New solution: Signals
- Reason: Maybe team does not adapt with RxJS, etc,...
- Expected present time: 30mins
- Speaker Bio: [https://www.linkedin.com/in/tranntn/]
- Power Point: https://docs.google.com/presentation/d/1meNAG7B5HGK6iPUG3JeaPTtB2cT8M4NC2Sadp3xEaVM/edit#slide=id.p1
- Profile Photo URL: Update later...