SoFunction
Updated on 2025-04-10

angularjs filter--filter and ng-repeat have a miraculous effect in combination

<!DOCTYPE html> 
<html> 
<head> 
 <link href="" rel="external nofollow" rel="stylesheet"> 
</head> 
 
<body ng-app="myApp" ng-controller="myCtrl"> 
 <input type="text" placeholder="Please enter your school ID or name" ng-model="query"> 
<table class="table-bordered"> 
 <tr ng-repeat="school in schoolList | <strong>filter:query</strong>" > 
  <td class="col-md-2">{{ }}</td> 
  <td class="col-md-2">{{ }}</td> 
 </tr> 
 <script src=""></script> 
 <script src=""></script> 
 <script src=""></script> 
</table> 
</body> 
</html> 

('myApp', []) 
 .controller('myCtrl', function ($scope) { 
  $ = [ 
   { 
    schoolId: 01, 
    schoolName: 'Sunshan University', 
   }, 
   { 
    schoolId: 02, 
    schoolName: 'Xiamen University', 
   }, 
   { 
    schoolId: 03, 
    schoolName: 'Beijing University', 
   }, 
   { 
    schoolId: 04, 
    schoolName: 'Fudan University', 
   } 
  ]; 
 }); 

The above is all the content of this article. I hope that the content of this article will help you study or work. I also hope to support me more!