nl_tokens: @ngdoc method @name $rootScope . Scope#$watchGroup @kind function
pl_tokens: function ( watchExpressions , listener ) { var oldValues = new Array ( watchExpressions . length ) ; var newValues = new Array ( watchExpressions . length ) ; var deregisterFns = [ ] ; var changeCount = 0 ; var self = this ; var masterUnwatch ; if ( watchExpressions . length === 1 ) { // Special case size of one return this . $watch ( watchExpressions [ 0 ] , function watchGroupAction ( value , oldValue , scope ) { newValues [ 0 ] = value ; oldValues [ 0 ] = oldValue ; listener . call ( this , newValues , ( value === oldValue ) ? newValues : oldValues , scope ) ; } ) ; } forEach ( watchExpressions , function ( expr , i ) { var unwatch = self . $watch ( expr , function watchGroupSubAction ( value , oldValue ) { newValues [ i ] = value ; oldValues [ i ] = oldValue ; changeCount ++ ; } , false , function watchGroupDeregNotifier ( ) { arrayRemove ( deregisterFns , unwatch ) ; if ( ! deregisterFns . <mask> ) { masterUnwatch ( ) ; } } ) ; deregisterFns . push ( unwatch ) ; } , this ) ; masterUnwatch = self . $watch ( function watchGroupChangeWatch ( ) { return changeCount ; } , function watchGroupChangeAction ( value , oldValue ) { listener ( newValues , ( value === oldValue ) ? newValues : oldValues , self ) ; } ) ; return function deregisterWatchGroup ( ) { while ( deregisterFns . length ) { deregisterFns [ 0 ] ( ) ; } } ; }