Evaluates the expr
expression in the context of the current scope during each
eval cycle
.
var scope = angular.scope(); scope.counter = 0; scope.$onEval('counter = counter + 1'); expect(scope.counter).toEqual(0); scope.$eval(); expect(scope.counter).toEqual(1);
angular.scope.$onEval(priority, expr[, exceptionHandler]);
priority – {number} –
Execution priority. Lower priority numbers get executed first.
expr – {string|function()} –
Angular expression or function to be executed.
exceptionHandler(optional=angular.service.$exceptionHandler) – {(function()|DOMElement)} –
Handler function to call or DOM element to decorate when an exception occurs.