Using typeahead, I am trying to set a couple of options, which are available as standard Bootstrap typeahead options
Using the following code, I'm able to set the "minLength" property by putting it in-line as "typeahead-min-length", but doing the same with "items" as "typeahead-items" does not. Is there a different/better/standard way to do this? Is there a way to attach an array of options to $scope?
<div class='container-fluid' ng-controller="TestController">
<input type="text" ng-model="selected"
typeahead="foo for foo in foo | filter:$viewValue" typeahead-items='5' typeahead-min-length='3'>
<pre>{{selected| json}}</pre> </div>
Update: I'm trying to stick with just AngularJS, and not use jQuery
This is my controller:
myAppModule.controller('TestController', function($http,$scope) {
$scope.selected = undefined;
$http.get('data/sample.json')
.then(function(results){
$scope.foo = results.data;
});
});