博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
angularjs 利用filter进行表单查询及分页查询
阅读量:7233 次
发布时间:2019-06-29

本文共 1154 字,大约阅读时间需要 3 分钟。

页面:

{
{item.imageLength/1024 | number:0}}KB
{
{item.imageName}}

 

这里主要说的是查询的数据结构:$scope.imagePaths=

{"imageinfo":

[{

imageLength"19505",imageName"company_logo.png"},

{imageLength"116010",imageName"crashed_icon.png"},

{imageLength"116411",imageName"logo.png"}

],"page":{size:2,index:1}};

需增加两个自定义的过滤器:

ng.module('index-filters', [])       .filter('paging',function(){            return function (items, index, pageSize) {                if (!items)                return [];                var offset = (index - 1) * pageSize;                return items.slice(offset, offset + pageSize);            }        })        .filter('size',function(){            return function (items) {                if (!items)                return 0;                return items.length || 0            }        })

 

效果如图:

转载于:https://www.cnblogs.com/bobo-show/p/5126775.html

你可能感兴趣的文章
什么是构造函数?它和普通函数的区别?
查看>>
mysql中key 、primary key 、unique key 与index区别
查看>>
zabbix使用企业微信发送告警信息
查看>>
zabbix4.0离线快速编译安装(编译安装方法)
查看>>
[Java开发之路](7)RandomAccessFile类详解
查看>>
Linux中的tty与pts
查看>>
Java socket示例(demo)TCP/IP
查看>>
error: WatchKit App doesn't contain any WatchKit Extensions whose WKAppBundleIdentifier matches
查看>>
计算UITextView的滑动高度
查看>>
AngularJs的UI组件ui-Bootstrap分享(四)——Datepicker Popup
查看>>
Java虚拟机------垃圾收集器
查看>>
UVA 1376 Animal Run 最短路
查看>>
oracle12c之 单机12.1.0.1打补丁
查看>>
封装了集中常用的文件读的方法
查看>>
51Nod-1080 两个数的平方和【暴力法】
查看>>
Web开发实用网站资源
查看>>
“深入理解”—交换排序算法
查看>>
ng-cordova 手机拍照或从相册选择图片
查看>>
ARM 汇编指令集 特点之一:条件执行后缀
查看>>
软工第五次作业--原型设计(结对)
查看>>