AngularJS - Expressions

What is AngularJS Expressions

AngularJS Expressions are used to bind application data to html.It starts with "{{" and ends with "}}".AngularJS application expressions are pure JavaScript expressions and outputs the data where they are used.


You can write expressions on Numbers,Strings,Objects,Arrays


AngularJS expressions can also be written inside ng-bind directives

What is AngularJS Expressions

AngularJS Expressions are used to bind application data to html.It starts with "{{" and ends with "}}".AngularJS application expressions are pure JavaScript expressions and outputs the data where they are used.


You can write expressions on Numbers,Strings,Objects,Arrays


AngularJS expressions can also be written inside ng-bind directives


AngularJS Expression Example

AngularJS expression can contain literals, operators and variables like JavaScript expression. For example, an expression {{10/2}} will produce the result 5 and will be bound to HTML.


Example


See the Pen AngularJS Example by Mukesh (@mrajpolaris) on CodePen.


AngularJS expression can contains literals of any data type.

Example:


See the Pen BKxoYz by Mukesh (@mrajpolaris) on CodePen.




AngularJS expression can contain variables declared via ng-init directive. Consider the example given below.


See the Pen expression using ng-init by Mukesh (@mrajpolaris) on CodePen.




References :- AngulaJS Documentation



Related Articles

  1. Maven Overview



comments powered by Disqus