Ad

AngularJS 2 Change Detection Is Bubbling / Capturing?

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>
Ad

Answer

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

Ad
source: stackoverflow.com
Ad