Ionic select: selected option not showing (selecting)

Hi everyone,

I can’t seem to get the select control working properly for some strange reason. This is what I do:

$scope.searchStaticBilled =  [
	                      		{
	                      	        name: 'All'
	                      		},
	                      		{
	                      	        name: 'Unbilled'
	                      		},
	                      		{
	                      	        name: 'Billed'
	                      		}
	];
	$scope.searchData =  {
							title: '', 
							billed: $scope.searchStaticBilled[0]
	};

Then in the template:

<select ng-model="searchData.billed" ng-options="billedStatic.name for billedStatic in searchStaticBilled"></select>

The select does not preselect the first option, and just selects nothing instead. Am I missing something?

Michael

Can you reproduce this in a codepen? I quickly threw your code into this codepen and it is selecting “All”.

Indeed, your codepen works as expected, but for some reason it doesn’t in my case. It looks like there is an extra empty option all the way on the top that is selected by default:

I should also mention that all of this happens in a Modal, could that have an impact of some sort?

Michael

Hmm maybe if there is something going on with the way you declare the modal. Here is a new codepen where it is in a modal: http://codepen.io/anon/pen/dPpXaa

Which version of Ionic are you using? This is pointing to the nightly build.