我有输入字段的输入和值来自函数$ scope.skillforJob,当我输入A时,它给了我appropritate值的技能,例如:Android,Angular Js,dropdown中的自动化测试。但我想要即使没有输入任何值,也会显示所有值的下拉列表。通过使用ng-focus,它可以为我提供所有值的响应。但是如何在我的HTML中显示它。
JS:
$scope.skillsforJob = functiond(data){
$scope.skills =
[{"name":"Android"},
{"name":"Angular JS"},
{"name":"Automation Testing"},
{"name":"BootStrap"},
{"name":"C"},
{"name":"CSS"},
{"name":"Hibernate"}]
}
HTML:
<input type="text" name="skills" id="skills" class="form-control"
autocomplete="off" ng-focus="skillsforJob(model.skills)" placeholder="Skills"
ng-required="true" ng-model="model.skills"
typeahead="skills.name for skills in skills | filter:$viewValue | limitTo:10"/>