1.What is Angular Js Expressions?

Angular Js Expressions are used to bind application data to HTML. It is similar to JavaScript expression.
it will write inside two curly braces. The Angular expressions are different from JavaScript.

An angular expression can display the result exactly where it is located or assigned.

{{expression}}


<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/
ajax/libs/angularjs/1.4.5/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<p>My Expression:{{1+2}}</p>
</div>
</body>
</html>

 

2.How to declare Angular Js numbers?

 Angular Js numbers are similar to JavaScript numbers.

<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com
/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="quantity=10;cost=8">
<p>Total expense of pens:{{quantity*cost}}</p>
</div>
</body>
</html>

 

 Here ng-init will store the value 10 in quantity.

3.How to declare Angular Js strings?

Angular Js Strings are similar to JavaScript Strings.

<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com/
ajax/libs/angularjs/1.4.5/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="fname='Ebc', lname='Learn'">
<p>Full name:{{fname+""+lname}}</p>
</div>
</body>
</html>

 

4.How to declare Angular Js objects?

Angular Js Objects are similar to JavaScript Objects

<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com/
ajax/libs/angularjs/1.4.5/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="name={fname:'Ebc', lname:'Learn'}">
<p>The name is:{{name.fname}}</p>
<p>The name is:{{name.lname}}</p>
</div>
</body>
</html>

 

5.How to declare Angular Js Arrays?

Angular Js Arrays are similar to JavaScript Array.

<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com/
ajax/libs/angularjs/1.4.5/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="numbers=[1,2,3,4,5,6,7,8]">
<p>The 6th result is:{{numbers[6]}}</p>	
<p>The 0th result is:{{numbers[0]}}</p>
</div>
</body>
</html>

 

6.What are the differences between Angular Js expression and JavaScript Js expression?

In Angular Js Expression loops, conditions and exceptions cannot be used but in JavaScript Expression, we can use.

Unlike JavaScript Expression, We will write Angular Js Expression inside Html

Unlike JavaScript Expressions Angular Js Expression Support Filters.

Both JavaScript Expressions Angular Js Expression contains literals, operators And variables.