@@ -616,9 +616,8 @@ function $RootScopeProvider(){
616
616
* - `targetScope` - {Scope}: the scope on which the event was `$emit`-ed or `$broadcast`-ed.
617
617
* - `currentScope` - {Scope}: the current scope which is handling the event.
618
618
* - `name` - {string}: Name of the event.
619
- * - `cancel ` - {function=}: calling `cancel ` function will cancel further event propagation
619
+ * - `stopPropagation ` - {function=}: calling `stopPropagation ` function will cancel further event propagation
620
620
* (available only for events that were `$emit`-ed).
621
- * - `cancelled` - {boolean}: Whether the event was cancelled.
622
621
*/
623
622
$on : function ( name , listener ) {
624
623
var namedListeners = this . $$listeners [ name ] ;
@@ -659,11 +658,11 @@ function $RootScopeProvider(){
659
658
var empty = [ ] ,
660
659
namedListeners ,
661
660
scope = this ,
661
+ stopPropagation = false ,
662
662
event = {
663
663
name : name ,
664
664
targetScope : scope ,
665
- cancel : function ( ) { event . cancelled = true ; } ,
666
- cancelled : false
665
+ stopPropagation : function ( ) { stopPropagation = true ; }
667
666
} ,
668
667
listenerArgs = concat ( [ event ] , arguments , 1 ) ,
669
668
i , length ;
@@ -674,7 +673,7 @@ function $RootScopeProvider(){
674
673
for ( i = 0 , length = namedListeners . length ; i < length ; i ++ ) {
675
674
try {
676
675
namedListeners [ i ] . apply ( null , listenerArgs ) ;
677
- if ( event . cancelled ) return event ;
676
+ if ( stopPropagation ) return event ;
678
677
} catch ( e ) {
679
678
$exceptionHandler ( e ) ;
680
679
}
0 commit comments