2017-09-18 164 views

回答

0
[<body ng-app="myApp" ng-controller="myCtrl"> 
    <table class="table table-striped"> 
    <thead> 
     <tr> 
     <th>Person Name</th> 
     </tr> 
     <tr> 
     <td> 
      <input type="text" ng-model="search.name" placeholder="Search Name..."> 
     </td> 
     </tr> 
    </thead> 
    <tbody> 
     <tr ng-repeat="listdata in names|filter:search"> 
     <td>{{listdata.name}}</td> 
     </tr> 
    </tbody> 
    </table> 
</body> 

var c=angular.module('myApp',[]); 

c.controller("myCtrl",function($scope){ 

    $scope.names = [ 
    {name: 'Krishnaiah'}, 
    {name: 'Ramana'}, 
     {name: 'ALex'}, 
     {name: 'Remo'}, 
     {name: 'Alena'}, 
    ] 
}) 

https://plnkr.co/edit/5Tb4aaHQn2eim3caTLyE?p=preview