English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

AngularJS ng-bind Instruction

AngularJS Reference Manual

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="myText='Hello World!'">
<p ng-bind="myText"></p>
</div>
</body>
</html>
Test and see ‹/›

Definition and Usage

ng-bind Directives tell AngularJS to use the value of the given variable or expression to replace the content of the HTML element.

If the given variable or expression is modified, the specified HTML element will also be modified.

Syntax

<element ng-bind="expression"></element>
Or as a CSS class:
<element></element>

All HTML elements support this directive.

Parameter Value

ValueDescription
expressionSpecify the variable or expression to be executed.

AngularJS Reference Manual