angular学习笔记2.repeater and filter

<!DOCTYPE html>
<html>
    <head>   
       <script src="json2.js"></script>
        <script src="angular.min.js"></script>
        
    </head>
    <body  ng-app id="ng-app" >
    <div>
    <input type="search" ng-model="search">
    </div>
    
  <div ng-controller="list">
  <ul>
    <li ng-repeat="name in names | filter:search">{{name}}</li>
    </ul>
  </div>
   
   
   <script>
    var list=function($scope){
$scope.names=['aa','bb','ccc','ddd','eee'];
};
   </script>
    </body>
</html>

你可能感兴趣的:(angular学习笔记2.repeater and filter)