教程 > angularjs 教程 > 阅读:21

angularjs 表达式详解——迹忆客-ag捕鱼王app官网

angularjs 表达式用于将应用程序数据绑定到 html。表达式写在双花括号内,例如 {{ expression }}。表达式的行为类似于 ng-bind 指令。angularjs 表达式是纯 javascript 表达式,并在使用它们的地方输出数据。

使用数字

expense on books : {{cost * quantity}} rs

使用字符串

hello {{student.firstname " " student.lastname}}!

使用对象

roll no: {{student.rollno}}

使用数组

marks(math): {{marks[3]}}

示例

以下示例显示了上述所有表达式的使用

testangularjs.htm


   
      angularjs expressions
   
   
   
      
      
      

hello {{student.firstname " " student.lastname}}!

expense on books : {{cost * quantity}} rs

roll no: {{student.rollno}}

marks(math): {{marks[3]}}

查看笔记

扫码一下
查看教程更方便
网站地图