最典型用法 双向绑定

<input type="text" value="{{apple}}" ng-model="apple" >


 

ng-value 用于设置 input 或 select 元素的 value 属性
<input ng-value="expression"></input>

 

ng-model  <input>, <select>, <textarea>, 元素支持该指令。
<element ng-model="name"></element>

 

 


ng-bind 指令告诉 AngularJS 使用给定的变量或表达式的值来替换 HTML 元素的内容。

如果给定的变量或表达式修改了,指定替换的 HTML 元素也会修改。所有的 HTML 元素都支持该指令。

<element ng-bind="expression"></element>

或作为 CSS 类:

<element class="ng-bind: expression"></element>


angularjs 表达式写在双大括号内:{{ expression }}。

AngularJS 表达式把数据绑定到 HTML,这与 ng-bind 指令有异曲同工之妙。

AngularJS 将在表达式书写的位置"输出"数据。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
相关资源
相似解决方案