AngularJS: Implement Search Filter on HTML Table

Introduction: In this article I am going to explain how to bind JSON data to HTML table using ng-repeat and apply searching option in AngularJS. Data in any column can be searched i.e. You can search by Book Id or title or author or price.

implement search filter on HTML table using angularjs

Implementation: Let’s create a sample html page to bind table and implement searching.
    <script src=""></script>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
        body {
            padding-top: 30px;
    <div class="container" ng-app="bookApp" ng-controller="bookController">
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon"><i class="fa fa-search"></i></div>
                <input type="text" class="form-control" placeholder="Search in any column" ng-model="searchKeyword">
        <table class="table table-bordered table-striped">
                    <td>Book Id</td>
                    <td>Book Title </td>
                <tr ng-repeat="book in bookList | filter: searchKeyword ">
                    <td>{{ }}</td>
                    <td>{{ book.title }}</td>
                    <td>{{ }}</td>
                    <td>{{ book.price }}</td>
        var bookApp = angular.module("bookApp", []);
        bookApp.controller('bookController', function ($scope) {
            $scope.bookList = [
                { "id": 1, "title": "Hobbit", "author": "Aman", "price"700 },
                { "id": 2, "title": "Lord of the rings", "author": "Sameer", "price": 1000 },
                { "id": 3, "title": "Harry Porter", "author": "Anuj", "price": 650 },
                { "id": 4, "title": "The little prince", "author": "Jatin", "price": 870 },
                { "id": 5, "title": "Angels and Demons", "author": "Shivam", "price": 890 }

 Now over to you:
A blog is nothing without reader's feedback and comments. So please provide your valuable feedback so that i can make this blog better and If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google+, Twitter, Linkedin and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox . Stay tuned and stay connected for more technical updates. 
Next Post »

If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily..