写一个下拉列表

<!DOCTYPE html>
<html ng-app='test'>
  <head>
     <meta charset="utf-8">
     <title>angular</title>
     <meta name="viewport" content="width=device-width,initial-scale=1.0,
     maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
         <script src="bower_components/angular/angular.js" charset="utf-8"></script>
     <script >
       var app=angular.module('test',[])
       app.controller('con1',function($scope,$http){
           $scope.arr=['apple','orange','pear','name','content']
           $scope.str=''
       })
     </script>
 </head>
 <body ng-controller='con1'>
    <input type="text" ng-model='str' name="" value="">
    <ul>
      <li ng-repeat='v in arr' ng-show='v.indexOf(str)!=-1'>{{v}} {{v.indexOf(str)!=-1}}</li>
    </ul>
 </body>
</html>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容