English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
<!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 ‹/›
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.
<element ng-bind="expression"></element> Or as a CSS class: <element></element>
All HTML elements support this directive.
Value | Description |
---|---|
expression | Specify the variable or expression to be executed. |