Applying Filter using user input while displaying records

Basics of Angular
Our sample student table database records are available here in JSON format. We will ask user to enter any text and based on this input we will dynamically change the filter to return matching rows.

The filter is applied to name column only.

{{ }}{{ }}{{ x.class }}{{ x.mark }}{{ x.gender }}
Basics of Angular: reading JSON
<div ng-app="my_app" ng-controller="studentCtrl">
<p><input type="text" ng-model="s_name"></p>
  <tr ng-repeat="x in details | filter :{'name':s_name}">
    <td>{{ }}</td><td>{{ }}</td><td>{{ x.class }}</td><td>{{ x.mark }}</td>
	<td>{{ x.gender }}</td>


var app = angular.module('my_app', []);
app.controller('studentCtrl', function($scope, $http) {
  .then(function (response) {$scope.details =;});
Basics of Angular Basics of Angular
Angular Home

Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2023 All rights reserved worldwide Privacy Policy Disclaimer