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">
  <h1>
  Sort order
  </h1>
    <ul>
      <li ng-repeat="person in people | orderBy : ['srtName','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',
      srtName: 'C: How to Program',
      title: 'STL',
      edition:38
    });
    
    $scope.people.push({
      name: '~Custom: Financial & Managerial Accounting MAL for Tulsa Community College',
      srtName: '~Custom: Financial and Managerial Accounting MAL for Tulsa Community College',
      title: 'ATL',
      age:36
    });
    
    $scope.people.push({
      name: 'C++ How to Program',
      srtName: 'C plus plus How to Program',
      title: 'TL',
      edition:37
    });

    $scope.people.push({
      name: '¡Arriba! Comunicación y Cultura, Canadian Edition Chapters 7-12',
      srtName: '¡Arriba! Comunicación y Cultura, Canadian Edition Chapters 7-12',
      title: 'ASE',
      edition:68
    });
    $scope.people.push({
      name: 'Dave James Smith',
      srtName: 'Dave James Smith',
      title: 'ZA',
      edition:22
    });

    $scope.people.push({
      name: 'Cid James Smith',
      srtName: 'Cid James Smith',
      title: 'BQ',
      edition:25
    });

  }

  getPeople();
});