1

I am trying to figure out, whether what is called Change Detection in AngularJS 2, actually corresponds to picking up events from the Capturing Phase and Bubbling Phase in ReactJS. Is that so? Could anybody provide an AngularJS 2 example?

ReactJS example:

<button type ="button"
        onClickCapture={this.onButtonCapture}
        onClick={this.onButtonBubble}>
  Capturing vs Bubbling
</button>
SnareChops
  • 13,175
  • 9
  • 69
  • 91
Socrates
  • 8,724
  • 25
  • 66
  • 113

1 Answers1

0

I haven't use React JS but looking at the example you are giving/requesting, I don't think they are related. Change Detection in Angular 2 refers to how the model changes, not events like click.

I hope this helps:

http://victorsavkin.com/post/110170125256/change-detection-in-angular-2

Langley
  • 5,326
  • 2
  • 26
  • 42
  • Ok, so if I understand it right then, the Change Detection in AngularJS 2 corresponds a bit to the Virtual DOM in ReactJS, but it is a little more active in terms of functionality, right? – Socrates Jan 09 '16 at 22:36
  • The way I see it Capturing Phase and Bubbling Phase are part of the Event System in ReactJS, which handles how component's events propagate between each other, event like click, mouse over, blur, etc. Change Detection in Angular handles how component's binding properties propagate between each other. React and Angular 2 both use Virtual DOM but for many more things than just these two concepts. – Langley Jan 09 '16 at 22:46