angular filter
日期格式化:
<span ng-bind="topShowList.sendTime|dateFormat|date:'MM-dd HH:mm'"></span>
deliciousApp.filter("dateFormat",[function(){
return function(time){
return new Date(Date.parse(time.replace(/-/g, "/")));
}
}]);
注意:topShowList.sendTime是string类型的日期,
例如“2015-- ::30”
两个参数的filter:
<span ng-bind="voucherList.voucherLot.isFreeShip | limitOption:voucherList.voucherLot.orderMoney"></span>
app.filter("limitOption",function(){
return function(isFreeShip,orderMoney){
if(isFreeShip==1 && orderMoney>0){
return "包邮,订单满"+orderMoney+"元可用";
}else if(isFreeShip==1 && orderMoney==0){
return "包邮";
}else if(isFreeShip==0 && orderMoney==0){
return "无限制";
}else if(isFreeShip==0 && orderMoney>0){
return "订单满"+orderMoney+"元可用";
}
}
});
<em class="price" ng-bind="goodsList.skuInfo.isPromotion !='0' ?goodsList.skuInfo.promotionPrice:goodsList.skuInfo.theOriginalPrice | currency : '¥' "></em>
结果:¥16.8
angular filter的更多相关文章
- Angular - - filter 过滤器
Filter Ng里的过滤器. currency:把一个数字格式化成货币模式(如$1,234.56).当没有提供任何货币符号时,默认使用当前区域的符号. 使用: HTML:{{ currency_ex ...
- 了解 : angular $filter stateful
{{ abc | myFilter }} angular.module('myStatefulFilterApp', []) .filter('decorate', ['decoration', fu ...
- Angular企业级开发(5)-项目框架搭建
1.AngularJS Seed项目目录结构 AngularJS官方网站提供了一个angular-phonecat项目,另外一个就是Angular-Seed项目.所以大多数团队会基于Angular-S ...
- angularJs中筛选功能-angular.filter-1
技术分享:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/angular-filter-learn-1/ 以下介绍为自己在使用ang ...
- angular drag and drop (ngDraggable) 笔记
这是原文 https://github.com/fatlinesofcode/ngDraggable 这是另一个dnd,这比较灵活,可以监听事件.我只用简单的排序功能,其他没去了解太多.有机会遇到功能 ...
- angular drag and drop (marceljuenemann) 笔记
这是原文 http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/simple 看起来很多功能,所以我只记入我需要的部分 ...
- AngularJS filter:search 是如何匹配的 ng-repeat filter:search ,filter:{$:search},只取repeat的item的value 不含label
1. filter可以接收参数,参数用 : 进行分割,如下: {{ expression | filter:argument1:argument2:... }} 2. filter参数是 对象 ...
- yeoman(转)
前言有一种技术可以提高我们的工作效率,可以让我们专心做我们擅长的事,可以屏蔽复杂性,可以规范我们的架构和我们的代码,可以让我们的享受编程的乐趣.Yeoman可以做到. 很多年以前,rails刚刚出世, ...
- Yeoman自动构建js项目
Aug 19, 2013 Tags: bowergruntJavascriptjsnodejsyeomanyo Comments: 10 Comments Yeoman自动构建js项目 从零开始nod ...
随机推荐
- is not configured for rpc
exec sp_serveroption @server='myserver', @optname='rpc', @optvalue='true' exec sp_serveroption @serv ...
- 通过IP获得IP所在地的三个接口
http://ip.qq.com/cgi-bin/searchip?searchip1=180.168.144.211 http://ip.taobao.com/service/getIpInfo.p ...
- LINQ to SQL系列四 使用inner join,outer join
先看一个最简单的inner join,在读取Student表时inner join Class表取的对应的Class信息: static void Main(string[] args) { usin ...
- 经典Bug 修改方法
右击工程名,“显示包内容”,删除提示错误的所有相关内容,(想当初,仅仅是删了一个图片,就各种报错,clean也没用,删了重新运行,也不成功.....有能力的话,最好能FQ,google你会发现很多技巧 ...
- linq世界走一走(LINQ TO SQL)
前言:作为linq的一个组件,同时作为ADO.NET的一个组成部分,LINQ TO SQL提供了将关系数据映射为对象的运行时基础结构. LINQ TO SQL是通过将关系数据库对象的数据模型(如一个数 ...
- iOS NSURLSession 下载
周五的时候,有个新的需求,要下载脚本,帮助玩家自动打怪,应该也是挂机的意思吧! 组长让我设计界面,让汤老师设计数据等.我觉得数据的挑战性更大一点,然后就接过来了. 自己还没有形成互联网思维,所以弄了一 ...
- django http 403 错误
在使用android的xUtils框架提交post请求到django服务器上面,出现错误,返回Forbiddeen.解决方法记录于此. 参考链接 http://blog.csdn.net/liangp ...
- 一个例子深入理解ClassLoader
文件类加载器,该加载器重载了loadClass方法,逻辑是只读取文件来加载类,不委托给父类加载器进行加载 package com.ydd.study.hello.classloader; import ...
- 另一个SqlParameterCollection中已包含SqlParameter
一般情况下,我们定义的一个SqlParameter参数数组,如: SqlParameter[] parms = { new SqlParamete ...
- PHP的日期和时间
<?php //2.获取日期和时间 //时间是一维的,所以任何一个时间的时间戳都是不一样的 //array getdate([int timestamp]); //string date(str ...