The basic mechanism of the change detection is to perform checks against two states, one is the current state, the other is the new state. If one of these states is different of the other, then something has changed, meaning we need to update (or re-render) the view.
Change detection goes through every components in the component tree (from top to bottom) to check if the model it depends on changed;
Note:
Examples in further slides will contain either all components as ChangeDetectionStrategy.Default (Default)
or all as
ChangeDetectionStrategy.OnPush (OnPush)
Components that have been re-rendered will be highlighted with green
Change detection will be propagated to the root parent component and call changed detection in child components. Note that event handler is required for CD
Note that child 4 has a click handler
Note child 3 @Input should be changed to trigger CD