美文网首页
写一个下拉列表

写一个下拉列表

作者: c59ffede9db6 | 来源:发表于2017-04-23 06:43 被阅读0次
    <!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>
    
    

    相关文章

      网友评论

          本文标题:写一个下拉列表

          本文链接:https://www.haomeiwen.com/subject/rumezttx.html