$rootScope.Scope.$watchGroup()

$watchGroup(watchExpressions, listener);

A variant of $watch() where it watches an array of watchExpressions. If any one expression in the collection changes the listener is executed.

  • The items in the watchExpressions array are observed via standard $watch operation and are examined on every call to $digest() to see if any items changes.
  • The listener is called whenever any expression in the watchExpressions array changes.

Parameters

Param Type Details
watchExpressions Array.<string|Function(scope)>

Array of expressions that will be individually watched using $watch()

listener function(newValues, oldValues, scope)

Callback called whenever the return value of any expression in watchExpressions changes The newValues array contains the current values of the watchExpressions, with the indexes matching those of watchExpression and the oldValues array contains the previous values of the watchExpressions, with the indexes matching those of watchExpression The scope refers to the current scope.

Returns

function()

Returns a de-registration function for all listeners.

doc_AngularJS
2016-03-29 16:10:41
Comments
Leave a Comment

Please login to continue.