Prev Demo
AngularJS
>
Simple Filter
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" /> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <script> var members = [ { username: 'SheoNarayan', address: 'Hyderabad', pin : '500049' }, { username: 'Munna', address: 'Bokaro', pin: '8256598' }, { username: 'Jay', address: 'Aurangabad', pin: '824101' }, { username: 'Sreeni', address: 'New York', pin: 'BY-524' } ]; var app = angular.module("app", []); app.controller("ListController", ["$scope", function ($scope) { $scope.Members = members; }]); </script> </head> <body> <div ng-app="app" ng-controller="ListController"> <h3>Filtering based on all columns</h3> Filter <input type="text" ng-model="allKeyword" /> <table class="table"> <tr> <th>UserName</th> <th>Address</th> <th>PIN</th> </tr> <tr ng-repeat="member in Members | filter: allKeyword"> <td>{{member.username}}</td> <td ng-bind="member.address"></td> <td>{{member.pin}}</td> </tr> </table> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output