Skip to content

Instantly share code, notes, and snippets.

@jamesmartin
Created January 29, 2013 09:38
Show Gist options
  • Save jamesmartin/4663046 to your computer and use it in GitHub Desktop.
Save jamesmartin/4663046 to your computer and use it in GitHub Desktop.
ul {
list-style-type: none;
padding-left: 0;
margin-left: 0;
}
<!doctype html>
<html ng-app>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script src="autocomplete.js"></script>
<link rel="stylesheet" href="autocomplete.css">
<link rel="stylesheet"
href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
</head>
<body>
<h2>Autocomplete</h2>
<div ng-controller='AutoCompleteController'>
<input type="search" ng-model='query' />
<ul ng-show='query' class="typeahead-x dropdown-menu-x">
<li ng-repeat='person in people | filter:query'>{{person.text}}</li>
</ul>
</div>
</body>
</html>
function AutoCompleteController($scope) {
$scope.people = [
{text: 'Joe Blogs'},
{text: 'Jack Black'}
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment