I’m not sure whether this is an Ionic question or just an Angular question, but I figured that the ionic community is so helpful I might go ahead and ask.
I have a service that returns an array of objects in a resolve in my router. That array of objects populates an
ng-options in an Ionic select tag. I have also tried using
ng-repeat in an
<option> with the same result
What I would like is to default select the first option in the array. All of the examples I see of this kind of thing assume that the array is already set, but mine is coming in aysnchronously. It seems no matter what I try, the select will not default to the first option once it is set.
I’ve tried using
ng-init with no success.
I have tried to reproduce this behavior in a codepen
Any help would be greatly appreciated.