ng-bind

Description

We can use ng-bind directive in place of the {{ }} template. The content is rendered as the child text node of the element on which ng-bind is declared.

Example

The following code shows how to ng-bind.


<!doctype html>
<html ng-app="myApp">
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.js"></script>
</head><!--from  w  w w  .jav  a 2s. com-->
<body ng-init="greeting = 'Hello World'">

  <p ng-bind="greeting"></p>

  <script>
    angular.module('myApp', [])
  </script>

</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Tutorial »




Introduction
Buildin Filters
Buildin Directives