Online Snippets Library

AngularJS Expressions With Example

AngularJS Expressions are used to binding data to HTML such as {{ expression }}. AngularJS expressions contain literals, operators, and variables.


<title>AngularJS Expression Example</title>  
<script SRC="">  
<div ng-app=''>  
<h3>AngularJS Numbers </h3>
<div ng-init="a=10;b=1">  
Total is: {{ a + b }}  
<h3>AngularJS Strings </h3>
<div ng-init="firstName='Max';lastName='Joe'">  
Full Name is : {{ firstName + " " + lastName }}
<h3>AngularJS Objects </h3> 
<div ng-init="student={ name:'Max', email:'[email protected]'}">  
Expression Result: {{ +"   "+ }}  
<h3>AngularJS Arrays </h3>
<div ng-app="" ng-init="points=[1,3,5,7,9]">
<p>The third result is <span ng-bind="points[2]"></span></p>