aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/rootScopeSpec.js
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-10-05 22:45:43 +0100
committerPete Bacon Darwin2013-10-05 22:45:43 +0100
commit47f7bd706efc5f2944d182e46c1b1d324298ff36 (patch)
tree66c199b3d5769b0cfb3457702310ec9f8883d552 /test/ng/rootScopeSpec.js
parent9089468092ba1c38ee1468871b723cab39e84c21 (diff)
downloadangular.js-47f7bd706efc5f2944d182e46c1b1d324298ff36.tar.bz2
fix(rootScope): make stopPropagation only stop its own event
All sibling event handlers residing on the same scope to were stopped if one of them called stopPropagation. Closes #4204
Diffstat (limited to 'test/ng/rootScopeSpec.js')
-rw-r--r--test/ng/rootScopeSpec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ng/rootScopeSpec.js b/test/ng/rootScopeSpec.js
index e8bf8eed..894c26d2 100644
--- a/test/ng/rootScopeSpec.js
+++ b/test/ng/rootScopeSpec.js
@@ -1060,6 +1060,14 @@ describe('Scope', function() {
expect(log).toEqual('2>1>0>');
});
+ it('should allow all events on the same scope to run even if stopPropagation is called', function(){
+ child.$on('myEvent', logger);
+ grandChild.$on('myEvent', function(e) { e.stopPropagation(); });
+ grandChild.$on('myEvent', logger);
+ grandChild.$on('myEvent', logger);
+ grandChild.$emit('myEvent');
+ expect(log).toEqual('2>2>2>');
+ });
it('should dispatch exceptions to the $exceptionHandler',
inject(function($exceptionHandler) {