AngularJS ng-bind 指令
AngularJS 教程
· 2019-04-01 11:16:40
AngularJS 实例
绑定 <p> 内的 innerHTML 到变量 myText:
<div ng-app="" ng-init="myText='Hello World!'">
<p ng-bind="myText"></p>
</div>
<p ng-bind="myText"></p>
</div>
定义和用法
ng-bind 指令告诉 AngularJS 使用给定的变量或表达式的值来替换 HTML 元素的内容。
如果给定的变量或表达式修改了,指定替换的 HTML 元素也会修改。
语法
<element ng-bind="expression"></element>
或作为 CSS 类:
<element class="ng-bind: expression"></element>
所有的 HTML 元素都支持该指令。
参数值
| 值 | 描述 |
|---|---|
| expression | 指定要执行的变量或表达式。 |
点击查看所有 AngularJS 教程 文章: https://codercto.com/courses/l/36.html
Rework
Jason Fried、David Heinemeier Hansson / Crown Business / 2010-3-9 / USD 22.00
"Jason Fried and David Hansson follow their own advice in REWORK, laying bare the surprising philosophies at the core of 37signals' success and inspiring us to put them into practice. There's no jarg......一起来看看 《Rework》 这本书的介绍吧!