AngularJs(Part 8)--Filters
Filters
AngularJS provides fileters to transfrom data from one kind to another . For example:
    {{user.birthday | date:'yyyy-MM-dd'}}
In this example, the date filter is used to format user's birthday.
A filter is nothing more than a global,named function that is invoked in view using the pipe(|)
symbol with parameters separated by the colon(:).
Fileters can be combined(chained) to form a pipeline.
    {{myLongString | limiTo:80 | lowercase}}
    
Generally,there are two kind of filters built in AngujarJS: formatting fileters and array-transforming
filters.
    array-transforming filters:limitTo; filter;orderBy.
    ng-repeat="item in logs | filter:{name:criteria,done:false}"
    the "filter" filter can also accept a function as it parameter.
    ng-repeat="item in logs | filter:checkName"
    
    $scope.checkName=function(item){
        return item.done=true;
    }
sometime, we want the result of the "filter" filter for other use, like showing the size, then we can
    ng-repeat="item in filteredLogs=(logs | filter:checkName)"
    
    Total:{{filteredLogs.length}}
AngularJs(Part 8)--Filters的更多相关文章
- AngularJS基础总结
		w3shools angularjs教程 wiki <AngularJS权威教程> Introduction AngularJS is a JavaScript framewo ... 
- 转载   angularJS filter 过滤器
		angularjs中的filter(过滤器) 标签: angularjsfilter 源文地址:http://www.ncloud.hk/技术分享/angularjs中的filter-过滤器/ f ... 
- Angular1.x 基础总结
		官方文档:Guide to AngularJS Documentation w3shools angularjs教程 wiki <AngularJS权威教程> Introd ... 
- 简单介绍AngularJs Filters
		网站链接:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/angular-filters/ Filter作用就是接收一个输入,通过某 ... 
- Part 8 AngularJS filters
		Filters in angular can do 3 different things 1. Format data 2. Sort data 3. Filter data Filters can ... 
- 【07】AngularJS Filters
		AngularJS Filters 过滤器可以使用一个管道字符(|)添加到表达式和指令中. AngularJS 过滤器 AngularJS 过滤器可用于转换数据: 过滤器 描述 currency[ˈk ... 
- AngularJS Filters
		过滤器可以使用一个管道字符(|)添加到表达式和指令中. AngularJS 过滤器 AngularJS 过滤器可用于转换数据: 过滤器 描述 currency 格式化数字为货币格式. filter 从 ... 
- [AngularJS] Extract predicate methods into filters for ng-if and ng-show
		Leaking logic in controllers is not an option, filters are a way to refactor your code and are compa ... 
- How to Create Custom Filters in AngularJs
		http://www.codeproject.com/Tips/829025/How-to-Create-Custom-Filters-in-AngularJs Introduction Filter ... 
随机推荐
- HDU - 1033  Edge  【模拟】
			题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1033 题意 给定一个起始点 300 420 走的第一步是 310 420 下面的每一步 都由 输入决定 ... 
- PAT 天梯赛 【】 L3-015. 球队“食物链” 【BFS+剪枝】
			题目链接 https://www.patest.cn/contests/gplt/L3-015 思路 用一个 数组标记 胜负 每次输入一行字符串 然后遍历 如果 碰到 W 那么 vis[i][j] = ... 
- 深入理解利用new创建对象的执行过程以Person p=new Person("张三",20);为例
			代码如下: class Person { private String name="haha"; private int age; private static String co ... 
- vim 操作符命令和位移(如删除和修改)
			一.字符删除命令:x,d,D x 删除光标下的字符,前面可以加入命令计数,如:5x 代表删除从当前光标到后面的5个字符,包括空格: X 删除光标前面的一个字符: dw 删除光标下到word后的数据: ... 
- ELK初步指南
			ELK的简单科普文章,加入了自己的一些理解. 内容包括ELK的基本介绍, 应用场景, 架构设计, 监控及自监控, 业界进展及推荐资料等. 用户故事 场景一 作为一个运维工程师, 某天虚拟机出现故障, ... 
- 大话设计模式--中介者模式 Mediator --C++实现实例
			1. 中介者模式: 用一个中介对象来封装一系列的对象交互,中介者使各对象不需要显式地相互引用,从而使其耦合松散,而且可以独立改变他们之间的交互. Mediator的出现减少了各个Colleague的耦 ... 
- Tstrings类简单介绍及实例
			用TStrings保存文件;var S: TStrings;begin S := TStringList.Create(); { ... } S.SaveToFile('config.txt' ... 
- inux命令学习笔记(5):rm 命令
			学习了创建文件和目录的命令mkdir ,今天学习一下linux中删除文件和目录的命令: rm命令. rm是常用的命令,该命令的功能为删除一个目录中的一个或多个文件或目录,它也可以将某个目 录及其下的所 ... 
- 如何查看myeclipse是否激活
			myEclipse---->Subscription information--->Subscription expiration date 看这个日期到什么时候!另外建议别用太高版本的M ... 
- luogu1754卡特兰数
			卡特兰数 打表 滑稽 #include<iostream> #include<cstdio> #include<algorithm> #include<cst ... 
