Angularjs Examples

AJS Examples


AngularJS ng-Bind Directive

The AngularJS ng-bind directive used to display value from model object.

Syntax

<html ng-app="">
<input type="text" ng-model="name"/>
<span ng-bind="name"/>

AngularJS ng-Bind Directive Example

<html>
<head>
<title>My first AngularJS ng-bind Directive code</title>
<script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</script>
<script>
//Defining Controller Using Standard Javascrip Object Constructor
function CustomerController($scope) {
  $scope.customer = { name: "Jimi Scott", address: "12-13-283/A1", email: "Jimi@yahoo.com" };
}
</script>
</head>
<body>
<div ng-app="">
<div ng-controller="CustomerController"> 
<span ng-bind="customer.name"></span>
<span ng-bind="customer.address"></span>
<span ng-bind="customer.email"></span>

</div>
</div>
</body>
</html>
See live Example