<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible"content="IE=edeg" />
<meta name="viewport"content="width=device-width,initial-scale=1" />
<!--[if lt IE 9]>
<script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script>
<script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.js"></script>
<![endif]-->
<title></title>
<meta charset="utf-8" />
<link rel="stylesheet"href="bootstrap-3.3.5/dist/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div data-ng-app="myApp"data-ng-controller="myCtrl">
<p>数量:<input type="text"data-ng-model="quantity" /></p>
<p>价格:<input type="text"data-ng-model="price" /></p>
<br />
<p>总价格为:<span>{{quantity*price | currency}}</span></p><!--currency过滤器将数字格式化为货币格式-->
</div>
</div>
<script src="jQuery/jquery-2.1.4.js"></script>
<script src="bootstrap-3.3.5/dist/js/bootstrap.min.js"></script>
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
angular.module("myApp", []).controller("myCtrl", function ($scope) {$scope.quantity=1,$scope.price=9.8})
</script>
</body>
</html>

currency 过滤器的更多相关文章

  1. AngularJS 过滤器

    过滤器可以使用一个管道字符(|)添加到表达式和指令中 AngularJS 过滤器可用于转换数据: currency 格式化数字为货币格式. filter 从数组项中选择一个子集. lowercase ...

  2. AngularJS过滤器

    1.过滤器可以使用一个管道字符(|)添加到表达式和指令中. 再次强调一点,所有的运行都要加入angularJS的库文件(类似JQuery的引用) 常见的AngularJS 过滤器 (1) lowerc ...

  3. 走进AngularJs(七) 过滤器(filter)

    过滤器(filter)正如其名,作用就是接收一个输入,通过某个规则进行处理,然后返回处理后的结果.主要用在数据的格式化上,例如获取一个数组中的子集,对数组中的元素进行排序等.ng内置了一些过滤器,它们 ...

  4. AngularJS快速入门指南06:过滤器

    thead>tr>th, table.reference>tbody>tr>th, table.reference>tfoot>tr>th, table ...

  5. 走进AngularJs(七) 过滤器(filter) - 吕大豹

    时间 2013-12-15 16:22:00  博客园-原创精华区 原文  http://www.cnblogs.com/lvdabao/p/3475426.html 主题 AngularJS 过滤器 ...

  6. 详解AngularJS中的filter过滤器用法

    系统的学习了一下angularjs,发现angularjs的有些思想根php的模块smarty很像,例如数据绑定,filter.如果对smarty比较熟悉的话,学习angularjs会比较容易一点.这 ...

  7. AngularJS(3)-过滤器

    过滤器可以通过一个管道字符(|)和一个过滤器添加到表达式中.. 1.uppercase/lowercase 大小写过滤器 2.currency过滤器 3.向指令添加过滤器 过滤器可以通过一个管道字符( ...

  8. angularJS之使用过滤器转化输出 (angularJS系列最后一篇)

    在视图模板中使用过滤器 过滤器也是一种服务,负责对输入的内容进行处理转换,以便更好地向用户显示. 过滤器可以在模板中的{{}}标记中使用: {{ expression | filter:arg1:ar ...

  9. vue.js基础知识篇(4):过滤器、class与style的绑定2

    代码下载:网盘 欢迎私信 第一章:过滤器 过滤器是对数据进行处理并返回结果的函数. 1.语法 语法是使用管道符"|"进行连接.过滤器可以接收参数,跟在过滤器后面,带引号的参数被当做 ...

随机推荐

  1. formValidation校验

    引用: https://www.cnblogs.com/aliger/p/3898216.html

  2. Google Zxing 生成二维码

    Net Zxing 源码地址 http://zxingnet.codeplex.com/ github 地址 https://github.com/zxing/zxing 新建一个Winform 项目 ...

  3. Nginx的验证、启动、停止、重启

    验证 验证nginx配置文件是否正确,进入sbin目录,输入以下命令: ./nginx -t  启动 进入sbin目录,输入以下命令: ./nginx -c /home/mppay/nginx/con ...

  4. Windows64bit-plsqldeveloper-install the easiest way

    The easiest way to add a 32 Bit Oracle Client: 1.Download the Oracle 11g or 12c Instant Client(http: ...

  5. LeetCode 981.基于时间的键值存储(C++)

    创建一个基于时间的键值存储类 TimeMap,它支持下面两个操作: 1. set(string key, string value, int timestamp) 存储键 key.值 value,以及 ...

  6. java内存区域与内存溢出

    JVM的内存区域划分: jvm的内存区域分为5部分:程序计数器,虚拟机栈,本地方法栈,堆跟方法区. 程序计数器,虚拟机栈,本地方法栈三部分是线程私有的,堆跟方法区是公共的. 1.程序计数器 是一块较小 ...

  7. 支付宝php支付接口说明

    直接把该代码放到PHP服务器下,直接访问index.php.1.文件列表: alipay_config.php    (基本参数配置页面,填写商家的支付宝安全校验码,合作id,支付宝帐号等内容)ind ...

  8. POJ 3177——Redundant Paths——————【加边形成边双连通图】

    Redundant Paths Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Sub ...

  9. POJ 1861 ——Network——————【最小瓶颈生成树】

    Network Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 15268   Accepted: 5987   Specia ...

  10. Spring课程 Spring入门篇 3-5 Spring bean装配(上)之Resource

    课程链接: 1 resource简析 2 resource代码演练 1 resource简析 urlsource:url对应的资源 classpath:获取类路径下的资源文件 filesystemre ...