Angular multiple - filters
by Harsha Jayamanna
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular.js"></script>
<div ng-app="sample">
<div ng-controller="peopleController">
<ul>
<li ng-repeat="person in people | orderBy : ['name','age']">
{{ person.name}} , {{ person.age}}
</li>
</ul>
</div>
</div>
CSS
body {
font-family: Arial;
}
JavaScript
var app = angular.module('sample', []);
app.controller('peopleController', function($scope) {
$scope.people = [];
function getPeople() {
$scope.people.push({
name: 'C#: How to Program',
title: 'STL',
edition:38
});
$scope.people.push({
name: '~Custom: Financial & Managerial Accounting MAL for Tulsa Community College',
title: 'ATL',
age:36
});
$scope.people.push({
name: 'C++ How to Program',
title: 'TL',
edition:37
});
$scope.people.push({
name: '¡Arriba! Comunicación y Cultura, Canadian Edition Chapters 7-12',
title: 'ASE',
edition:68
});
$scope.people.push({
name: 'Dave James Smith',
title: 'ZA',
edition:22
});
$scope.people.push({
name: 'Cid James Smith',
title: 'BQ',
edition:25
});
}
getPeople();
});