angularjs 实现排序功能
2020-11-16 21:13
标签:io re cti c div ar 实现公式:{{orderBy_expression | orderBy:expression:reverse}} Example var app=angular.module("myApp",[]); angularjs 实现排序功能,搜素材,soscw.com angularjs 实现排序功能 标签:io re cti c div ar 原文地址:http://www.cnblogs.com/java-php/p/3700492.html
app.controller("Ctrl",function($scope){
$scope.friends=[
{name:"John",phone:‘555-1212‘,age:10},
{name:"Mary",phone:‘555-9876‘,age:19},
{name:"Mike",phone:‘555-4321‘,age:21},
{name:"Admin",phone:‘555-5678‘,age:35},
{name:"Julie",phone:‘555-8765‘,age:29},
];
$scope.predicate=‘-age‘;
});
Sort
predicate={{predicate}};reverse={{reverse}}
[unsorted]
Name
phone
number
Age
{{friend.name}}
{{friend.phone}}
{{friend.age}}