diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index a37eda5a8ee0..5bd652147162 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -616,9 +616,8 @@ function $RootScopeProvider(){ * - `targetScope` - {Scope}: the scope on which the event was `$emit`-ed or `$broadcast`-ed. * - `currentScope` - {Scope}: the current scope which is handling the event. * - `name` - {string}: Name of the event. - * - `cancel` - {function=}: calling `cancel` function will cancel further event propagation + * - `stopPropagation` - {function=}: calling `stopPropagation` function will cancel further event propagation * (available only for events that were `$emit`-ed). - * - `cancelled` - {boolean}: Whether the event was cancelled. */ $on: function(name, listener) { var namedListeners = this.$$listeners[name]; @@ -659,11 +658,11 @@ function $RootScopeProvider(){ var empty = [], namedListeners, scope = this, + stopPropagation = false, event = { name: name, targetScope: scope, - cancel: function() {event.cancelled = true;}, - cancelled: false + stopPropagation: function() {stopPropagation = true;} }, listenerArgs = concat([event], arguments, 1), i, length; @@ -674,7 +673,7 @@ function $RootScopeProvider(){ for (i=0, length=namedListeners.length; i1>'); }); @@ -685,17 +685,6 @@ describe('Scope', function() { }); - it('should return event object with cancelled property', function() { - child.$on('some', function(event) { - event.cancel(); - }); - - var result = grandChild.$emit('some'); - expect(result).toBeDefined(); - expect(result.cancelled).toBe(true); - }); - - describe('event object', function() { it('should have methods/properties', function() { var event;