AngularJS中$scope.status(排序例子)
来源:互联网 发布:apache 测试工具 编辑:程序博客网 时间:2024/06/06 08:50
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="js/angular.min.js"></script> </head> <body ng-app="Mapp" ng-controller="Mctrl"> <table border="1px" cellspacing="0" cellpadding="0"> <tr> <th ng-click="orderBy('id')">编号</th> <th>点击数</th> <th>标题</th> </tr> <tr ng-repeat="(k,v) in data"> <td>{{v.id}}</td> <td>{{v.click}}</td> <td>{{v.title}}</td> </tr> </table> <script> var m = angular.module("Mapp", []) m.controller("Mctrl", function($scope,$filter) { $scope.data = [{ id: 1, click: 100, title: '罗马' },{ id: 2, click: 200, title: '伊利' },{ id: 3, click: 300, title: '阿富汗' }]; $scope.status={id:false,click:false,title:false}; $scope.orderBy = function(field){ $scope.status[field]=!$scope.status[field]; alert($scope.status[field]) $scope.data = $filter("orderBy")($scope.data,field,$scope.status[field]) } }) </script> </body></html>
阅读全文
0 0
- AngularJS中$scope.status(排序例子)
- Angularjs中scope与$scope
- AngularJS中$scope用法
- AngularJS scope
- AngularJs--Scope
- AngularJS: $scope
- AngularJS 中的scope($scope)
- angularjs中scope与rootscope 区别
- Angularjs中scope的一些属性
- 对AngularJs中$scope的深入理解
- angularJs中directive的scope ‘@’,‘=’区别
- angularJs中$scope数据序列化
- angularjs service中依赖注入$scope报错解决方式
- angularjs中My97DatePicker无法通过$scope.ngModel获取值解决
- angularJs中controller控制器scope父子集作用域实例
- AngularJS自定义指令directive:父类scope和指令中scope之间的通信
- AngularJs学习笔记--Scope
- angularjs $scope.$apply()
- C语言实现顺序栈
- 输入一行字符,统计其中英文字符、数字字符、空格和其他字符的个数
- C#TCPClient应用-一个简单的消息发送和接收
- AVA 中BIO,NIO,AIO的理解
- KKT条件介绍
- AngularJS中$scope.status(排序例子)
- File 经典拷贝文件代码
- 用IOT的思维来管理我们的查看我们重要业务的服务器健康状态。-概述篇
- Java复习笔记(三)-----抽象类和接口
- 双流神经网络及3D卷积系列论文阅读笔记
- 机器学习笔记(VII)线性模型(III)对数几率回归和极大似然估计
- E558: Terminal entry not found in terminfo
- 使用svn:externals建立SVN文件(夹)链接
- Mysql中分页查询两个方法比较