How to display length of filtered ng-repeat data in AngularJS ? Last Updated : 30 Nov, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The task is to Display the length of filtered ng-repeat data. Here we are going to use alias expression to solve this problem. Approach: To display the length of filtered ng-repeat data we use an alias expression. We create an alias for the variable used to filter the ng-repeat data and display the length of the alias at each moment. Syntax: <element ng-repeat="expression | filter: search as result"> Content... </element> <p> {{ result.length }} <p> Example: html <!DOCTYPE html> <html> <head> <title> Angular JS Filtered data length </title> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"> </script> </head> <body > <h1 style = "color:green; text-align:center;" > GeeksForGeeks </h1> <div ng-app = "mainApp" ng-controller = "studentController"> <input type = "text" ng-model = "searchName"> <br/> <ul> <li ng-repeat = "student in students | filter: searchName as result"> {{ student.name + ', marks:' + student.marks }} </li> </ul> <p>length of filtered data:- {{ result.length }}</p> </div> <script> var mainApp = angular.module("mainApp", []); mainApp.controller('studentController', function($scope) { $scope.students = [ {name:'Aman', marks:70}, {name:'Aditya', marks:80}, {name:'Pratyush', marks:92}, {name:'Prakhar', marks:95}, {name:'Pranjal', marks:75}, {name:'Sunny', marks:69} ]; }); </script> </body> </html> Explanation: Here, we are displaying the details of students and there is a search box to search by name of student. Now, we bind the input of that search box in AngularJS searchName variable. SearchName variable is used to filter, we create an alias of it which is result here and then we display the result.length. So as the length of filtered ng-repeat data change, length of result also change. Output: Initial screen would be: Then after the search, filtered ng-repeat data length change: Comment More infoAdvertise with us Next Article How to Sort List by Date Filter in AngularJS ? P pratyushranjan14 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Misc Similar Reads How to iterate over filtered (ng-repeat filter) collection of objects in AngularJS ? The task is to iterate over a collection of objects already filtered by ng-repeat filters and after clicking a button, change some property of only those objects which got filtered. Suppose you have a collection of objects that were filtered by a text search within a title property on each object. N 3 min read How to Sort List by Date Filter in AngularJS ? AngularJS is a feature-based JavaScript framework that uses various tools to create dynamic single-page web applications. While developing the application we have the requirement to play with the data in AngularJS and sort this list of data by a date properly in descending order. This can be done us 5 min read How to apply filters to *ngFor in Angular ? In this article, we will see How to apply filters to *ngFor in AngularJS, along with understanding their basic implementation through the examples. NgFor is used as a Structural Directive that renders each element for the given collection each element can be displayed on the page. Implementing the f 3 min read How to filter by object property in AngularJS? Filtering by object property in AngularJS is the concept of choosing the specific objects from the data array which is based on the individual properties. In creating a web application, this is the most common task that deals with the data that needs to be sorted and then displayed to the user. Deve 6 min read How to fetch the details using ng-repeat in AngularJS ? In this article, we will see how to fetch the details with the help of the ng-repeat directive in Angular, along with understanding its implementation through the illustrations. AngularJS contains various types of pre-defined Directives, where most of the directives start with ng which denotes Angul 2 min read How to display static JSON data in table in Angular ? In this article, we will see How to display static JSON data in the table in Angular. We will be displaying static data objects in Angular Table. We need to iterate over the object keys and values using key values and then handle them in the table. We will be using the bootstrap table and Angular Pr 3 min read Like