首先定义一个json文件:

然后写HTML文件:

 <div id="box">
<!--第一个下拉框-->
<select ng-model="a">
<option value="age">按照年龄排序</option>
<option value="code">按照编码排序</option>
<option value="name">按照姓名排序</option>
</select>
<!--升序还是降序-->
<select ng-model="b">
<option value="">升序</option>
<option value="-">降序</option>
</select>
<!--一个搜索框-->
<input type="text" placeholder="请输入要搜索的内容" ng-model="c"/>
</div>
<!--渲染的数据-->
<div id="wrap">
<table>
<tr>
<th>编码</th>
<th>姓名</th>
<th>年龄</th>
</tr>
<tr ng-repeat="item in data|filter:c|orderBy:b+a">
<td>{{item.code}}</td>
<td>{{item.name}}</td>
<td>{{item.age}}</td>
</tr>
</table>
</div>

angular:

 <script>
var app = angular.module("mk",[]);
app.controller("test",function($scope,$http){
$http.get('json/index.json').success(function(data){
$scope.data = eval(data);
$scope.a = "code";
})
})
</script>

在这种运用到的过滤器有filter 、orderBy

这样就完成了一个简单的排序,希望能帮到大家!!!!!!!!

最新文章

  1. ASP.NET Identity 2新增双重认证、帐号锁定、防伪印章功能并修复了一些bug
  2. (转)Tomcat数据源连接池加密
  3. js②
  4. java加密解密的学习
  5. Struts2(十三)国际化-internationalization
  6. 第十二章 管理类型(In .net4.5) 之 操作字符串
  7. Linux imagemagic(转载)
  8. 重学《C#高级编程》(对象与类型)
  9. 第一章:JavaScript简介
  10. Error creating bean with name &#39;signController&#39;: Injection of autowired dependencies failed
  11. hihoCoder #1094 : Lost in the City(枚举,微软苏州校招笔试 12月27日 )
  12. Ubuntu 搭建 GlusterFS 过程笔记
  13. 使用.net core efcore根据数据库结构自动生成实体类
  14. vue drag 对表格的列进行拖动排序
  15. Centos系统快速添加yum源
  16. 浏览器内核 Trident Gecko Presto Webkit
  17. python基础之Day6
  18. android 布局文件中xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  19. Shiro笔记(三)授权
  20. [Android] 仿照 Last App Switcher 写的小程序

热门文章

  1. [ADB Shell]Android Debug Bridge常用命令
  2. Reviewing notes 2.1 of Mathematical analysis
  3. 启动storm集群及配置
  4. sqlalchemy orm数据类型验证方法比较
  5. python 连接数据库 pymysql模块的使用
  6. RNA-seq分析htseq-count的使用
  7. C++_标准模板库STL概念介绍1-建立感性认知
  8. 洛谷 P2518 [HAOI2010]计数 (组合数)
  9. c# 动态生成继承类并实现序列化特性
  10. asp.net mvc 静态化