How to make ng-options work with ng-repeat in ion-list

Hi, I’m in the process of creating a “user setting view” and need some help. At the moment my code lists out Car and Motorbike with correct Choices but I’m struggling to get the “default” option to work.

Any suggestions on what I’m doing wrong?


.controller('FavoritsCtrl', function($scope,) {
$scope.options = [
            {name: 'Car',
                Choices: [
                    {id:0, name:'Nissan'},
                    {id:1, name: 'Bmw'},
                    {id:2, name: 'Volvo'}
                default: {id:1, name: 'Bmw'}
            {name: 'Motorbike',
                Choices: [
                    {id:0, name:'Ducati'},
                    {id:1, name: 'Kawasaki'},
                    {id:3, name: 'Yamaha'}
                default: {id:0, name:'Ducati'}



 <ion-list ng-repeat="item in options">
                <ion-item class="item item-input item-select">
                    <div class="input-label">
                    <select ng-model="item.default" ng-options=" for item in item.Choices">
1 Like

I had a hard time understanding this and making it work. After reading this article I was able to solve this kin of problem when working with arrays of objects.

The default value should reference one of the objects in $scope.options

@joseadrian, the article you provided helped me to solve the problem, thank you.