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. hbase离线定时入库shell脚本-小栗子

    #!/bin/bash #######数据类型(cdr,ims,pc,.ngn_sip)###### dir=*** ############# #原始文件地址 oripath=/bigdata/da ...

  2. 2014年互联网IT待遇

    1. 13k*14~16k*145.美团 13k*15~16k*15,也有更高的.6.去哪儿 11k*16~15k*167.人人技术类(12K-14K)*14 (2014)8.58同城 20w+9.网 ...

  3. node 渲染html模板配置

    node 渲染html模板配置 安装swig模块 npm install swig--save - dev 加载swig模块 var swig = require('swig'); 模板配置 //第一 ...

  4. snowflake(canvas)

    <!DOCTYPE html><html><head><meta http-equiv="Content-Type" charset=&q ...

  5. 仿联想商城laravel实战---7、lavarel中如何给用户发送邮件

    仿联想商城laravel实战---7.lavarel中如何给用户发送邮件 一.总结 一句话总结: 设置邮件服务器,比如163邮箱 lavarel中配置邮件服务,在.env中 控制器中使用Mail对象发 ...

  6. 英语发音规则---Y字母

    英语发音规则---Y字母 一.总结 一句话总结: 1.Y字母在单词最前面读发[j]? yes /jes/ [jɛs] n. 是 yard /jɑːd/ [jɑd] n. 院子 yellow /'jel ...

  7. C#winform拖拽实现获得文件路径

    1.关键知识点说明: 通过DragEnter事件获得被拖入窗口的“信息”(可以是若干文件,一些文字等等),在DragDrop事件中对“信息”进行解析.窗体的AllowDrop属性必须设置成true;且 ...

  8. 【二叉树的递归】06填充每个节点中的下一个正确的指针【Populating Next Right Pointers in Each Node】

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 给定一个二叉树 struct Tr ...

  9. php中socket的使用

    php中使用socket在服务器端主要使用这么几个函数: 1/$socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP)创建一个socket 2/sock ...

  10. ACdream1430SETI(后缀自动机)

    问题: Amateur astronomers Tom and Bob try to find radio broadcasts of extraterrestrial civilizations i ...