-
Part 3 Angular Change Detection - The cycle and the job
When I use the word change detection, this is not specific enough in Angular. It can be referred as change detection cycle, or it can be referred as change detection job. The cycle refer to the process of recursive updating the hierachy of angular views. In the context of each component, the job refers to the work of comparing the current state and previous state of the component, updating the view of the component when there is a difference. In the last post, I mentioned. Zone.js will call
applicationRef.tick()
, and it will start a change detection cycle. During the cycle, the job can happen depending on some condition. But in the cycle, what does it actually do? This is a pretty complicated process. Here is some very high-level pseudo code, and it omits lots of details, let’s just focus on the high-level process. -
Part 2 Angular Change Detection - Zone.js
In Part 1, I showcased the best practice in Angular change detection. Now I aim to delve into the rationale behind it. This topic is about Zone.js
-
Part 1 Angular Change Detection, what is the end game?
-
Observable with async pipe used multiple times in Angular template
There is a question in stackoverlfow Angular - Observable with async pipe used multiple times in template… Good Practice or Bad?
-
Demystifying the syntax of structural directive
Structural directive is a special directive. Angular comes with a couple of them such as
ngIf
,ngFor
. Angular provides detailed documentation about the structural directive. There are two syntaxes to use a directive, the sugar syntax ( starting with an asterisk*
) and the<ng-template>
syntax. The sugar syntax is shorter because it combines the following two features of<ng-template>
binding.