Filtering & Sorting using SharePoint online List with Angular JS & Rest API

In this article we can learn how to do Filtering & Sorting in SharePoint List with Angular JS & Rest API
In a page added the script editor and place the below code.
        th {
            background-color: blue;
            color: white;
    <script src=""></script>
    <script src=""></script>


    var myAngApp = angular.module('SharePointAngApp', []);
    myAngApp.controller('spCustomerController', function ($scope, $http) {
            method: 'GET',
            url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('InfoList')/items?$select=Title,Employee,Company",
            headers: { "Accept": "application/json;odata=verbose" }
        }).success(function (data, status, headers, config) {
            $scope.customers = data.d.results;
$scope.mySortFunction = function(customer) {//Sorting Iteam
                                                return customer[$scope.sortExpression];
                                    return parseInt(customer[$scope.sortExpression]);
        }).error(function (data, status, headers, config) {




    <h1> Filtering and sorting in SharePoint List using AngularJS-REST-API !!</h1>
    <br /><br />
    <div ng-app="SharePointAngApp" class="row">
        <div ng-controller="spCustomerController" class="span10">
                Sort by:
                <select ng-model="sortExpression">
                    <option value="Title">Title</option>
                    <option value="Employee">Employee</option>
                    <option value="Company">Company</option>

            <br />
            Search By Any:
            <input type="text" ng-model="search.$" />
            <br />
            <br />
            <table class="table table-condensed table-hover">

                <tr ng-repeat="customer in customers  | orderBy:mySortFunction | filter:search">


Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment


  1. Thanks for the solution. When I click the search text box it refreshes. Please do you have any solution To this

  2. Best Selection of Dashiki Shirts and Pants.We are retail and wholesale of dashiki shirts. dashiki skirt