angular/angular.js — pull request #3571 by stsvilik (2013-08-14 04:01:34+00:00)
Title: Fix for event.stopPropagation() and $emit method

This fix addresses an issue where event.stopPropagation() prematurely ends execution of event listeners assigned to the same scope from which they are $emit-ted.

For example you assign 2 listeners to the same scope:
a)
scope.on('myEvent', function(evt) {
evt.stopPropagation();
//Do something
});
b) Somewhere else on the same scope, perhaps inside other directive or controller
scope.on('myEvent', function(evt) {
//Do something else
});

Currently handler in 'a' will prevent handler 'b' from executing even though they are on the same exact scope, but this is not the intention of the stopPropagation() function. Intention is to prevent 'myEvent' from bubbling into $parent scope.

If we take jQuery or just plain DOM eventing model, we'll see that stopPropagation does NOT prevent multiple handlers that are attached to the same node from firing.