Skip to content

Instantly share code, notes, and snippets.

Created February 23, 2013 22:48
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mirontoli/5021701 to your computer and use it in GitHub Desktop.
Angular UI autocomplete example
var autocompleteApp = angular.module("autocompleteApp");
var autocompleteController = function($scope) {
var availableTags = [
$scope.autocompleteOptions = {
source: availableTags
autocompleteApp.('ui.config', {
autocomplete: {
minLength: 2,
delay: 500
<!DOCTYPE html>
<div ng-app="autocompleteApp">
<div ng-controller="autocompleteController">
<input type="text" ui-autocomplete="autocompleteOptions">
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>
<script src="ui/angular-ui.min.js"></script>
<script src="app.js">
Copy link

abulte commented Apr 15, 2013

Is this supposed to work? Because it doesn't on my project ;-) That's a shame because I find it very elegant!

Copy link

abulte commented Apr 15, 2013

I found your blog post, I think I'll understand better now.

Copy link

Sorry, I didn't see your comment. Good, that it is clearer now.

Copy link

Would it be sane to replace line 4 with a JQuery AJAX call to get a list of options from the server?

Copy link

xbenjii commented May 6, 2014

Why would you do that? Just use the $http scope and create an http request.

Copy link

Does it work when I use array of object in lieu of array of string?If not, how to work?plz.... very helpful to me if it work on array of object

Copy link

jasp402 commented Jul 25, 2016

angular.min.js:17 Uncaught Error: No module: autocompleteApp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment