# angular.scope.$onEval

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

## Description

Evaluates the `expr` expression in the context of the current scope during each `eval cycle`.

### Example

             var scope = angular.scope();
             scope.counter = 0;
             scope.$onEval('counter = counter + 1');
             expect(scope.counter).toEqual(0);
             scope.$eval();
             expect(scope.counter).toEqual(1);

## Usage

    angular.scope.$onEval(priority, expr[, exceptionHandler]);

### Parameters

- `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.