Answers for "selectpicker angularjs first row empty"

0

selectpicker angularjs first row empty

<div ng-controller="SelectCtrl as sel">
	<p>Select with no default option:
		<select ng-model="sel.myvar" ng-options="opt.label for opt in sel.myoptions"></select>
	</p>
 
	<p>Select with default option:
		<select ng-model="sel.myvar" ng-options="opt.label for opt in sel.myoptions">
			<option value="">-- please choose an animal --</option>
		</select>
	</p>
 
	<button ng-click="sel.myvar=sel.myoptions[0]">cat</button>
	<button ng-click="sel.myvar=sel.myoptions[1]">dog</button>
	<button ng-click="sel.myvar={value:'fish',label:'Bubbles'}">fish</button>
 
</div>
Posted by: Guest on February-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language