You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Angular.js select directive have a convenient way to define null-value option. If you put <option> tag without value inside <select>, it will be treated as null-option which sets model value to null.
It is useful sometimes to provide user ability to reset selected value. Now I have to implicitly add that item to other choices in repeat.
$scope.persons=[{"id": null,"name": "No person"}].concat(otherPersons)
<ui-selectng-model="form.person"><ui-select-matchplaceholder="Select person...">{{$select.selected.name}}</ui-select-match><ui-select-choicesrepeat="person.id as person in persons">{{person.title}}</ui-select-choices></ui-select>
I don't want to do it and it would be good if you will have an option for provide this option through html, for example
<ui-selectng-model="form.person"><ui-select-matchplaceholder="Select person...">{{$select.selected.name}}</ui-select-match><ui-select-null-choice>No person</ui-select-null-choice><ui-select-choicesrepeat="person.id as person in persons">{{person.title}}</ui-select-choices></ui-select>
It is similar to select directive logic and looks good for me. What do you think?
MyEidos, chornobils, javasparx, AlcesAlces, WillCallahan and 5 more