|
|
|
@ -11,7 +11,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
angular.module('typeahead', ['ui.bootstrap', 'radians'])
|
|
|
|
|
.controller('TypeaheadCtrl', function ($scope, $http) {
|
|
|
|
|
$scope.selected = undefined
|
|
|
|
|
$scope.selected = ""
|
|
|
|
|
$scope.states = function(query){
|
|
|
|
|
return $http.get("states.json").then(function(response){
|
|
|
|
|
console.log("response", response)
|
|
|
|
@ -24,8 +24,7 @@ angular.module('typeahead', ['ui.bootstrap', 'radians'])
|
|
|
|
|
<body>
|
|
|
|
|
<div class='container-fluid' ng-controller="TypeaheadCtrl">
|
|
|
|
|
<pre>Model: {{ selected | json }}</pre>
|
|
|
|
|
<div ng-model="selected" typeahead="state for state in states($viewValue)" contenteditable>
|
|
|
|
|
</div>
|
|
|
|
|
<div ng-model="selected" typeahead="state for state in states($viewValue)" contenteditable="true" style="width:100px; height: 20px;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|