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. HIVE 总结

    http://blog.csdn.net/wisgood/article/details/17186181 常见错误 http://blog.csdn.net/sunnyyoona/article/d ...

  2. 20145229实验三实验报告——敏捷开发与XP实践

    20145229实验三实验报告--敏捷开发与XP实践 实验名称 敏捷开发与XP实践 实验内容 XP基础 XP核心实践 相关工具 ** 实验步骤**### 敏捷开发与XP 软件工程包括下列领域:软件需求 ...

  3. 修改SecureCRT终端的Home和End功能键

    SecureCRT真是个不错的ssh客户端工具,但在使用时发现跟自己的一些使用习惯不符合,例如home.end.pageup.pagedown和delete等键.默认情况下一些按键的功能如下:page ...

  4. RabbitMQ高级应用

    高级应用一: 手动模式和自动应答模式 1. 了确保消息不会丢失,RabbitMQ支持消息应答.消费者发送一个消息应答,告诉RabbitMQ这个消息已经接收并且处理完毕了.RabbitMQ就可以删除它了 ...

  5. Netty使用LineBasedFrameDecoder解决TCP粘包/拆包

    TCP粘包/拆包 TCP是个”流”协议,所谓流,就是没有界限的一串数据.TCP底层并不了解上层业务数据的具体含义,它会根据TCP缓冲区的实际情况进行包的划分,所以在业务上认为,一个完整的包可能会被TC ...

  6. 爬虫第一篇:爬虫详解之urllib.request模块

    我将urllib.request 的GET请求和POST请求两种方法做了总结 GET请求 GET请求爬取: import urllib.request import urllib.parse head ...

  7. form表单验证失败,阻止表单提交

    form表单验证失败,阻止表单提交 效果演示: 贴上完整代码: <!DOCTYPE html> <html lang="en"> <head> ...

  8. ajax调试小技巧

    在编写ajax时出现了问题,通过myXmlHttpRequest.responseXML无法获取值. 可以尝试打印出responseText的值.截图如下所示:

  9. PLSQL Developer使用技巧整理

      Shortcut: =============================================================================== Edit/Und ...

  10. java:类集操作,多对多的关系

    java:类集操作,多对多的关系 //一个课程有多个学生报名, //一个学生可以报名多个课程 demo.java, Student.java, Course.java' public class Co ...