I've already tried searching for a solution to my issue on Google, but I couldn't find anything that really helped me. I'm looking to create an input field that also functions like a dropdown. This way, I can either type in my own data or select from the dropdown options. I attempted to use the select element, but then I could only select predefined data and not enter my own. That's why I decided to use datalist instead. My goal is to populate my datalist with data from an array, like this:
index.html
<input type="text" ng-model="model.person.profession" list="professions"/>
<datalist id="professions">
<option ng-repeat="profession in professions" value="{{profession.id}}">{{profession.name}}</option>
</datalist>
app.js
$scope.professions = [
{'id':1, 'name':'doctor'},
{'id':2, 'name':'farmer'},
{'id':3, 'name':'astronaut'}
];
However, when I try to view my data in the dropdown, it doesn't show up. What am I missing here?