I use angularjs in a project and in which I use ng-options to generate.
Initially, when the pages reload and the selection is not selected, html is created as follows:
<select size="3" ng-model="item" ng-options="s.name for s in itemlist"> <option value="?" selected="selected"></option> <option value="0">Item 1</option> <option value="1">Item 2</option> <option value="2">Item 3</option> </select>
But when I select an item (e.g. item 2), the first empty selection disappears. I know this happens when the ng model is installed by choice. But I want the first selection to always be empty so that the user can reset the filter.
Thanks in advance.
javascript angularjs options
arnold 04 Oct 2018-12-13T00: 00Z
source share