Skip to content

Instantly share code, notes, and snippets.

@jcserracampos
Forked from mirontoli/app.js
Last active Aug 29, 2015
Embed
What would you like to do?
var autocompleteApp = angular.module("autocompleteApp");
var autocompleteController = function($scope) {
//http://jqueryui.com/autocomplete/
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$scope.autocompleteOptions = {
source: availableTags
}
}
autocompleteApp.('ui.config', {
autocomplete: {
minLength: 2,
delay: 500
}
});
<!DOCTYPE html>
<html>
<head></head>
<body>
<div ng-app="autocompleteApp">
Autocomplete:
<br>
<div ng-controller="autocompleteController">
<input type="text" ui-autocomplete="autocompleteOptions">
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.3/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>
<script src="ui/angular-ui.min.js"></script>
<script src="app.js">
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment