Angularjs Examples

AJS Examples


AngularJS Object Expression

In this AngularJS object expression example you will learn how to initialize and display object data in HTML DOM elements.

Here you can view the output of the example and you can also "try it yourself" by clicking on "Live Demo" button given at the bottom.

AngularJS Object

Various AngularJS Object usage with expressions.

Syntax

<div ng-init="customer={ name:'Jimi Scott',address:'12-13-283/A1', email:'jimi@yahoo.com'}">  
  Expression Result: <b>{{ " Name: " + customer.name + "  Address:   " 
  + customer.address + "  Email : " + customer.email }}</b>  
</div>      

AngularJS Object Expression Example

<!DOCTYPE html>  
<html>  
<head>  
<title>AngularJS Expression with Object</title>  
<script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">  
</script>  
</head>  
<body style="background-color:#DDE4E9;font-family:arial;">      
  <fieldset style="background-color:#DDE4E9;">                  
    <legend>AngulerJS Expression with Object Example</legend> 
<div ng-app=''>  
<div ng-init="customer={ name:'Jimi Scott',address:'12-13-283/A1', email:'jimi@yahoo.com'}">  
  Expression Result: <b>{{ " Name: " + customer.name + "  Address:   " 
  + customer.address + "  Email : " + customer.email }}</b>  
</div>  
</div> 
 </fieldset> 
</body>  
</html>