0

ReactJs has virtual DOM to render the changes. Angular2 does not contain virtual DOM. Angular2 is reactive like ReactJS. With any change in angular2 the whole component is not changed but the portion of component gets changed. What is used by Angular2 to show the change in portion of Component ? Edit: Let me be more specific. I know change detection is the way. But change detection happens to the Model. Once change detection unidirectional cycle runs the real DOM has to be manipulated. This is specific point does Angular use a virtual DOM concept and if not what is the substitute to manipulate real DOM.

Arun Kumar
  • 323
  • 1
  • 4
  • 15
  • I am disappointed **Günter Zöchbauer**. Both the questions are different. I am not asking about ShadowDOM or VirtualDOM. I am asking who is responsible to pick changes from change detection and render on the real DOM. – Arun Kumar Oct 18 '16 at 07:44
  • Short answer of my question is Zone. Any change outside zone will not be reflected to the DOM. – Arun Kumar Oct 28 '16 at 06:29
  • I am not able to understand why *Gunter* marked my question as duplicate. May be I am new with forum but not able to understand why he did this.... – Arun Kumar Oct 28 '16 at 06:31

2 Answers2

1

Angular2 uses Zones to detect the changes in any component. Every component has its ChangeDetection object, which detects the changes.

In Angualar 2 project you have a Component's Tree, it it goes from the root to the below and look for the changes. Angular 2 has a Unidirectional Flow

Suren Srapyan
  • 66,568
  • 14
  • 114
  • 112
0

Angular uses change detection with unidirectional data flow and uses structural directives like *ngFor, *ngIf, *ngSwitchCase or custom directives to update the part of the DOM where change detection recognized changes.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567