本文为 h5edu 机构官方 html5培训 教程,主要介绍:javascript强化教程javascript强化教程 —— angularjs 表达式
angularjs 使用 表达式 把数据绑定到 html。angularjs 表达式
angularjs 表达式写在双大括号内:{{ expression }}。
angularjs 表达式把数据绑定到 html,这与 ng-bind 指令有异曲同工之妙。
angularjs 将在表达式书写的位置"输出"数据。
angularjs 表达式 很像 javascript 表达式:它们可以包含文字、运算符和变量。
实例 {{ 5 + 5 }} 或 {{ firstname + " " + lastname }}
angularjs 实例
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/ang ... gt%3b
</head>
<body>
<div ng-app="">
<p>我的第一个表达式: {{ 5 + 5 }}</p>
</div>
</body>
</html>
angularjs 数字
angularjs 数字就像 javascript 数字:
angularjs 实例
<div ng-app="" ng-init="quantity=1;cost=5">
<p>总价: {{ quantity * cost }}</p>
</div>
使用 ng-bind 的相同实例:
angularjs 实例
<div ng-app="" ng-init="quantity=1;cost=5">
<p>总价: <span ng-bind="quantity * cost"></span></p>
</div>
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号