栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

AngularJS表达式讲解及示例代码

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

AngularJS表达式讲解及示例代码

表达式用于应用程序数据绑定到HTML。表达式都写在双括号就像{{表达式}}。表达式中的行为跟ng-bind指令方式相同。 AngularJS应用表达式是纯javascript表达式,并输出它们被使用的数据在那里。

使用数字

Expense on Books : {{cost * quantity}} Rs


使用字符串

Hello {{student.firstname + " " + student.lastname}}!


使用对象

Roll No: {{student.rollno}}


使用数组

Marks(Math): {{marks[3]}}


例子

下面的例子将展示上述所有表达式。

testAngularJS.html 文件代码如下:


AngularJS expressions

Sample Application

  

Hello {{student.firstname + " " + student.lastname}}!

Expense on Books : {{cost * quantity}} Rs

Roll No: {{student.rollno}}

Marks(Math): {{marks[3]}}

输出

在Web浏览器打开textAngularJS.html。看到结果如下:

以上就是对AngularJS 表达式的资料整理,后续继续补充相关资料,谢谢大家对本站的支持!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/94857.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号