angular.js实现列表排序排序的方法
如下所示:
html ng-app head title order by/title meta http-equiv=' X-UA-Compatible '内容='IE=edge'/meta name='viewport '内容=' width=设备宽度,初始比例=1'/link href='./book/CSS/bootstrap。CSS“rel=”外部no跟随“rel=”样式表type=' text/CSS '/script src=' http :/file/angular-1。0 .1 .量滴js ' type=' text/JavaScript '/script/head body div class=' table-responsive ' ng-controller=' demo controller ' table id=' TB ' class=' table-table-bordered table-hover ' the和tr th class=' col-MD-2 '编号/th class=' col-MD-4 '国家/th class=' col-MD-4 '名称/th class=' col-MD-3 '年龄/th/tr/ad t body id=' t body ' ng-repeat=' stu in data | order by : '-age ' | 限制为: 10 ' tr class=' { { cls($ index)} ' TD { $ index 1 } }/tdtd { { stu。 country } }/tdtd { { stu。name } }/tdtd { { stu。年龄} }/TD/tr/t正文/表格/div脚本类型=' text/JavaScript '函数演示控制器($ s)魏国,country: '曹操,年龄: 45岁,{ seq: 2,姓名: '魏国,country: '张辽,年龄: 34 },{ seq: 3,名称: '魏国,country: '司马懿,年龄: 36岁,{ seq : 4,姓名: '魏国,country: '夏侯淳,年龄: 40 },{ seq: 5,姓名: '蜀国,country: '刘备,年龄: 50岁,{ seq : 6,姓名: '蜀国,country: '关羽,年龄: 45岁,{ seq: 7,姓名: '蜀国,country: '张飞,年龄: 46岁,{ seq: 8,姓名: '蜀国,country: '赵云,年龄: 35岁,{ seq : 9,姓名: '吴国,country: '孙权,年龄: 30 },{ seq: 10,姓名: '吴国,country: '周瑜,年龄: 32岁,{ seq : 11,姓名: '吴国,country: '鲁肃,年龄: 33岁,{ seq : 12,姓名: '吴国,country: '黄盖,年龄: 55 }];$scope.cls=函数(i) { return (i 1) % 4==1?活动的":";} }/脚本/正文/html效果:
以上这篇angular.js实现列表排序排序的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持我们。
版权声明:angular.js实现列表排序排序的方法是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。