AngularJS binds application/module data to HTML using Expressions.

AngularJS - What are Expressions

  • JavaScript code snippets placed in bindings

  • e.g. {{'Hello'+' World'}}, {{1+2}}

  • Evaluated against a scope object

  • Forgiving, don’t throw an error for null and undefined

  • Can use filters with expressions to format data

  • Expressions do not have direct access to DOM objects - window, document or location

  • Written inside double braces or ng-bind directive

  • They can contain literals, operators, and variables

AngularJS - What can you do with Expressions

Expression Usage:

  • Used to format data 

  • Used to evaluate data with respect to $scope

AngularJS - Using Expressions

  • Calling a method from an Expression

  • One time binding