自动完成文本框和AngularJS

自动完成文本框和AngularJS,第1张

自动完成文本框和AngularJS
<html lang="en">  <head>    <meta charset="utf-8" />    <title>jQuery UI Autocomplete - Default functionality</title>    <script data-require="angular.js@1.3.9" data-semver="1.3.9" src="https://pre.angularjs.org/1.3.9/angular.js"></script>    <link rel="stylesheet" href="//pre.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css" />    <script src="//pre.jquery.com/jquery-1.10.2.js"></script>    <script src="//pre.jquery.com/ui/1.11.2/jquery-ui.js"></script>    <script>  var app=angular.module('app',[]);  app.controller('ctrl',function($scope){   $scope.availableTags = [      "Actionscript",      "Applescript",      "Asp",      "BASIC",      "C",      "C++",      "Clojure",      "COBOL",      "ColdFusion",      "Erlang",      "Fortran",      "Groovy",      "Haskell",      "Java",      "Javascript",      "Lisp",      "Perl",      "PHP",      "Python",      "Ruby",      "Scala",      "Scheme"    ];    $scope.complete=function(){      console.log($scope.availableTags);    $( "#tags" ).autocomplete({      source: $scope.availableTags    });    }   });  </script>  </head>  <body ng-app="app" ng-controller="ctrl">    <div >      <label for="tags">Tags: </label>      <input id="tags" ng-keyup="complete()"/>    </div>  </body></html>

为您服务的傻瓜
http://plnkr.co/edit/5XmPfQ78vRjSrxE0Tt3B?p=preview
对不起,我不擅长摆弄。



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5586204.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-14
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存