Angularjs Examples

AJS Examples


AngularJS $scope.$eval() Function

The AngularJS $eval method is used to executes the AngularJS expression on the current scope and returns the result. In AngularJS, expressions are similar to JavaScript code snippets that are usually placed in bindings such as {{ expression }}. AngularJS used internally $eval to resolve AngularJS expressions, such as {{variable}}.

The important difference between $eval and $parse is that $eval is a scope method that executes an expression on the current scope, while $parse is a globally available service. The $eval method takes AngularJS expression and local variable object as parameter.

Syntax

AngularJS $scope.$eval() Function Example