Guide: Expressions

Improve this DocAngular Expressions

Angular expressions are JavaScript-like code snippets that are mainly placed in interpolation bindings such as <span title="{{ attrBinding }}">{{ textBinding }}</span>, but also used directly in directive attributes such as ng-click="functionExpression()".

For example, these are valid expressions in Angular:

  • 1+2
  • a+b
  • user.name
  • items[index]

Angular Expressions vs. JavaScript Expressions

Angular expressions are like JavaScript expressions with the following differences