Front End, IT

(4) AngularJs Expressions {{Expression}}

  • AngularJS binds data to HTML using Expressions.
  • AngularJS expressions can be written inside double braces: {{ expression }}.
  • AngularJS solve the expression, and return the result.
  • AngularJS expressions can contain literals, operators, and variables like JavaScript expressions.
  • If you remove the ng-app directive, HTML will display the expression as it is, without solving it.
  • Look at the following code, and review the used expressions.
  • Note: Notice that ng-app is written inside the html tag, as we use more than one div. Try to write it in anther tag, such as in the first div only.
AngularJs Expressions

  • When you run the code, you will see the following result:
AngularJs Expressions
  • Run and review the code on codepen.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s