top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are expressions in AngularJS? Give the syntax with example.

+1 vote
500 views
What are expressions in AngularJS? Give the syntax with example.
posted Dec 30, 2016 by Pramod Huilgol

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

AngularJs Expressions

Expressions are used to bind application data to html. Angular expressions are unit of code which resolves to value. The code is written inside double curly braces : {{ expression }}. AngularJS expressions can also be written inside a directive: ng-bind="expression". AngularJS application expressions are pure javascript expressions and outputs the data where they are used.

answer Jan 10, 2017 by Sahana
0 votes

Expressions in AngularJS are just like JavaScript code snippets. JavaScript code is usually written inside double braces: {{expression}}. In other words, Angular Expressions are JavaScript code snippets with limited sub-set. Expressions are included in the HTML elements.

Like JavaScript expressions, AngularJS expressions can also have various valid expressions. We can use the operators between numbers and strings, literals, objects and arrarys inside the expression {{ }}. For example,

{{ 2 + 2 }} (numbers)
{{Name + " " + email}} (string)
{{ Country.Name }} (object)
{{ fact[4] }} (array)

Example

For more details click on the link

answer Jul 25, 2017 by Jdk
...