Angularjs Examples

AJS Examples


AngularJS ng-Init Directive

The AngularJS ng-bind directive used to initializes an AngularJS Application default data.

Syntax

<div ng-init="customer={name:'Jimi',address:'12-13-283/A1',email:'jimi@yaho.com' }">

AngularJS ng-Init Directive Example

<html>
<head>
<title>My first AngularJS code</title>
<Script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</Script>
</head>
<body>
<div ng-app="">
<div ng-init="customer={name:'Jimi',address:'12-13-283/A1',email:'jimi@yaho.com' }"> 
<span ng-bind="customer.name"></span>
<span ng-bind="customer.address"></span>
<span ng-bind="customer.email"></span>
</div>
</body>
</html>
See Live Example