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的更多相关文章

  1. AngularJS基础总结

    w3shools    angularjs教程  wiki   <AngularJS权威教程> Introduction AngularJS is a JavaScript framewo ...

  2. 转载 angularJS filter 过滤器

    angularjs中的filter(过滤器) 标签: angularjsfilter   源文地址:http://www.ncloud.hk/技术分享/angularjs中的filter-过滤器/ f ...

  3. Angular1.x 基础总结

    官方文档:Guide to AngularJS Documentation   w3shools    angularjs教程  wiki   <AngularJS权威教程> Introd ...

  4. 简单介绍AngularJs Filters

    网站链接:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/angular-filters/ Filter作用就是接收一个输入,通过某 ...

  5. Part 8 AngularJS filters

    Filters in angular can do 3 different things 1. Format data 2. Sort data 3. Filter data Filters can ...

  6. 【07】AngularJS Filters

    AngularJS Filters 过滤器可以使用一个管道字符(|)添加到表达式和指令中. AngularJS 过滤器 AngularJS 过滤器可用于转换数据: 过滤器 描述 currency[ˈk ...

  7. AngularJS Filters

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

  8. [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 ...

  9. How to Create Custom Filters in AngularJs

    http://www.codeproject.com/Tips/829025/How-to-Create-Custom-Filters-in-AngularJs Introduction Filter ...

随机推荐

  1. iOS 8以后 定位手动授权问题

    ios8以后 都是手动授权定位权限 不过不处理这块 在ios8以后的系统就会默认永不授权 即关闭了定位权限 处理办法如下 .导入框架头文件 #import <CoreLocation/CoreL ...

  2. python学习笔记20160413

    1. type(val) #查看val的类型. 2. 出现错误的时候, 读懂错误信息.3. raw_input('xxx') #读取用户输入都是string类型数据.4. ValueError: in ...

  3. Linux 上关于iptables

    有几个命令: 1.service iptables staus   2.service iptables start    3.service iptables restart   有个配置文件/ec ...

  4. sqlserver 2008 创建数据库的时候不是空库,里面总有数据的解决办法

    SqlServer2008 里面有个系统数据库 Model 数据库,在创建新数据库的时候,会以它为模板创建,所以如果发现你的Model数据库比较大,说明里面有很多模板数据.此时如果需要去创建没有数据的 ...

  5. Alembic Migrations

    Introduction The migrations in the alembic/versions contain the changes needed to migrate from older ...

  6. Spring Boot- 设置拦截打印日志

    import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.Aspect; import org.aspe ...

  7. jquery详解图片平滑滚动

    jquery详解图片平滑滚动 随便写了个DOM,没有美观性,见谅 原理: 1.定义两组ul列表放图,第一个ul放5张图,第二个ul为空 2.为什么要用两个ul?因为要用到jQuery的克隆方法clon ...

  8. Android之setContentView和LayoutInflater

    setContentView: 1.常用的构造函数: 1)setContentView(int layoutResID) 2)setContentView(View view) 3)setConten ...

  9. 【遍历二叉树】12往二叉树中添加层次链表的信息【Populating Next Right Pointers in Each Node II】

    本质上是二叉树的层次遍历,遍历层次的过程当中把next指针加上去. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  10. bzoj 4500: 矩阵 差分约束系统

    题目: Description 有一个n*m的矩阵,初始每个格子的权值都为0,可以对矩阵执行两种操作: 选择一行, 该行每个格子的权值加1或减1. 选择一列, 该列每个格子的权值加1或减1. 现在有K ...