Triggering Angular change detection manually

Angular application can be considered as a tree of components but anonymously  Angular uses a low level abstraction called view. View stores the reference to associated component class and component class holds the reference to associated view. Operations like DOM updates, property checks are performed on views. The change detection runs on view. Every view has a link to its child via nodes property so the actions can be performed on child views also. Views have a state and its value decides whether to run change detection for views and child views or not to perform the change detection. 

                                                    If you are dealing with a large, enterprise level application a performance hit is likely to be met. Defaultly Angular checks and detects everything rendered in the template so to prevent it we need to implement manual change detection. If you want the full control of change detection a combination of OnPush change detection strategy with methods like detectChanges(), detach(). markForCheck() helps. If OnPush is enabled Angular will not detect changes by analyzing each template expression. It will detect changes to @input values as a whole. If the input is an object you need to use immutable data.While using OnPush Angular will only check changes when notified. There are four scenerios.

An @input reference has changed, the component or its children raise an event, A bound observable in template changes, manual are the four scenarios. 

When detecting changes manual ,detect changes() will run change detection in that component and its children. MarkForCheck will add components and its children to the default change detection cycle for one cycle.