Expressions of AngularJS

AngularJS Forms

In AngularJS, To bind application data to html expressions are used. It is written inside of double braces like {{expression}}. It uses same way as ng-bind.

Following example will show all the expressions of AngularJS:

<title>My AngularJS Expressions</title>
<h1>AngularJS Expressions</h1>
<div ng-app="" ng-init="quantity=2;cost=10; colleague={firstname:'Tim',lastname:'Ererld',salary:25000};Points=[10,20,30,40,50]">
<p>Welcome {{colleague.firstname + " " + colleague.lastname}}!</p>
<p>Price(Rs) : {{quantity * cost}}</p>
<p>Salary: {{colleague.salary}}</p>
<p>Points: {{Points[3]}}</p>
<script src=""></script>

Leave a Reply

Your email address will not be published. Required fields are marked *