过滤器~排序
来源:互联网 发布:知乎怎么注册不了 编辑:程序博客网 时间:2024/05/15 03:37
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="../AngularJS/angular.js" ></script> <script> //获取系统时间对象 var date = new Date(); //定义AngularJS应用程序 var app = angular.module("myApp",[]); //定义控制器 app.controller("myCtrl",function($scope){ $scope.money = 500; $scope.hello = "hello"; $scope.date = date; $scope.user = ["zs","ls","ls","ww"]; $scope.users = [{ name:"zs", age:20 },{ name:"ls", age:21 },{ name:"ww", age:22 }]; $scope.student = [{ id:1, name:"张三", age:20 },{ id:2, name:"王五", age:21 },{ id:2, name:"李四", age:22 }]; $scope.order = function(text){ console.log(text); return text["id","-name"]; } }) </script> </head> <body ng-app="myApp" ng-controller="myCtrl"> <p>货币过滤器:{{money | currency:"$"}}</p> <p>大写过滤器:{{hello | uppercase}}</p> <p>日期过滤器:{{date | date:"yyyy.MM.dd HH:mm:ss"}}</p> <p>长度过滤器:{{user | limitTo:-2}}</p> <p>子元素过滤器:{{users | filter:{'name':'ls','age':21} }}</p> <hr /> <p>默认排序:{{student | orderBy}}</p> <p>角标升序:{{student | orderBy:"+"}}</p> <p>角标降序:{{student | orderBy:"-"}}</p> <p>角标升序:{{student | orderBy:true}}</p> <p>ID升序:{{student | orderBy:"id"}}</p> <p>ID降序:{{student | orderBy:"-id"}}</p> <p>ID升序name升序:{{student | orderBy:["id","name"]}}</p> <p>ID升序name将序:{{student | orderBy:["id","-name"]}}</p> <p>ID升序name将序:{{student | orderBy:order}}</p> </body></html>
阅读全文
0 0
- 过滤器~排序
- angular过滤器表格排序
- Angularjs 过滤器完成排序
- AngularJS学习记录-过滤器(排序方式过滤)
- angularjs的过滤器实现搜索与排序
- AngularJS过滤器应用之表头排序
- angular-过滤器orderBy排序limitTo长度
- spring security标准过滤器以及排序
- Angular内置过滤器+orderBy排序+模糊查询
- 过滤器
- 过滤器
- 过滤器
- 过滤器
- 过滤器
- 过滤器
- 过滤器
- 过滤器
- 过滤器
- 学习Linux C编程之语句 问题-break和continue
- Python 安装theano tensorflow keras 教程与pip安装失败解决方法
- spring 中事务配置方式以及事务的传播性、隔离级别
- http状态码查询,各种返回码的详解(200、206、500、416、403、404)
- SpringBoot 读写分离实现(AbstractRoutingDataSource)
- 过滤器~排序
- linux下配置QT嵌入式编译环境
- 【Java基础知识】Annotation01_注解(Annotation)基本概念
- request取url的各个部分
- 学习他人经验之循环语句深入学习(转载)
- python3中报错:TypeError: 'range' object doesn't support item deletion
- python对json的操作总结
- 【云栖大会】阿里云李津:持续释放技术红利_为1000万企业提供技术平台
- matplotlib--annotate