ProgrammerGuide.Net | Step by Step Programmer Guide

AngularJS Expressions with Objects by Example | AngularJS Interview Question | AngularJS Programmer Guide and Tutorials

AngularJS expressions are written inside double braces: {{ expression }}. AngularJS objects are like JavaScript objects.

<div ng-app=“” ng-init=“person={firstName:’John’,lastName:’Doe’}”>


<p>The name is {{ person.lastName }}</p>


</div>

We can also rewrite the above code using ng-bind as below:

<div ng-app=“” ng-init=“person={firstName:’John’,lastName:’Doe’}”>


<p>The name is <span ng-bind=“person.lastName”></span></p>


</div>

Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?