I have a text box and I want to apply the autocomplete on it. I am using the following plugin:
autocomp
and it works fine but as soon as I combine it with An
<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://code.angularjs.org/1.3.9/angular.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.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 class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags" ng-keyup="complete()"/>
</div>
</body>
</html>
Plunker for you http://plnkr.co/edit/5XmPfQ78vRjSrxE0Tt3B?p=preview Sorry I am not good at fiddle.