selectpicker angularjs first row empty

Solutions on MaxInterview for selectpicker angularjs first row empty by the best coders in the world

showing results for - "selectpicker angularjs first row empty"
Lylou
02 Jan 2019
1<div ng-controller="SelectCtrl as sel">
2	<p>Select with no default option:
3		<select ng-model="sel.myvar" ng-options="opt.label for opt in sel.myoptions"></select>
4	</p>
5 
6	<p>Select with default option:
7		<select ng-model="sel.myvar" ng-options="opt.label for opt in sel.myoptions">
8			<option value="">-- please choose an animal --</option>
9		</select>
10	</p>
11 
12	<button ng-click="sel.myvar=sel.myoptions[0]">cat</button>
13	<button ng-click="sel.myvar=sel.myoptions[1]">dog</button>
14	<button ng-click="sel.myvar={value:'fish',label:'Bubbles'}">fish</button>
15 
16</div>