How to show default option in select option (drop down box) in an ng-repeat of rows?

I have a list of names and activities displayed with ng-repeat which shows tabular data (shortened for brevity). The list box populates and I can show which SchoolDayID was previously stored and the value for this updates if you change the selection in the drop-down. When the form loads it does not select any value in the drop-down list. For the ng-select I have tried several variations, none of which worked. I am several days into this and have no idea what I am doing wrong or failing to understand. How do I get each drop down per row to select the correct item?

I have tried:

<select ng-model="selectedSchoolDayID" ng-init="selectedSchoolDayID = a.SchoolDayID" ng-options="x.ID as x.code for x in AMListData" >
</select>

and even:

<select class="form-group">
   <option id="selectedSchoolDay" name="selectedSchoolDay" value="{{AMListData[0].ID}}" selected="{{AMListData[0].ID}} == {{a.SchoolDayID}}">{{AMListData[0].code}}</option>
   <option id="selectedSchoolDay" name="selectedSchoolDay" value="{{AMListData[1].ID}}" selected="{{AMListData[1].ID}} == {{a.SchoolDayID}}">{{AMListData[1].code}}</option>
   <option id="selectedSchoolDay" name="selectedSchoolDay" value="{{AMListData[2].ID}}" selected="{{AMListData[2].ID}} == {{a.SchoolDayID}}">{{AMListData[2].code}}</option>
</select>

Data for list box:

$scope.AMListData = participationSvc.amlist();

// from participationSvc:
'amlist': function listSelectionsController($scope) {
            return [
                { ID: '0', code: 'PM Programming' },
                { ID: '1', code: 'AM Programming' },
                { ID: '2', code: 'Supplemental'   }
            ];
        },

HTML/AngularJS part:

<div ng-repeat="a in selectedAttendees | orderBy : a.LastName">

<!-- there could be many rows, once per name of person. each row should have a drop-down of its own -->

    <div class="row">
        <div>{{a.LastName}}</div>
        ...
        <select class="col-md-5" id="SchoolDay" name="SchoolDay" ng-model="a.SchoolDayID">
            <option data-ng-repeat="x in AMListData" name="SchoolDay" value={{x.ID}} ng-selected="{{(x.ID == selectedSchoolDay) ? true: false}}" >{{x.code}}</option>
        </select>

         <!-- Show me current selection and drop-down list data -->
        <b> &nbsp; Selected ID:  {{a.SchoolDayID}}</b>
        <br />
        <ul>
        <li ng-repeat="x in AMListData">{{x.ID}}   {{x.code}}</li>
        </ul>
    </div>
</div>

Answer

You can use default value in controller

<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>

<div ng-app="myApp" ng-controller="myCtrl">

<select ng-model="selectedSchoolDayID"  ng-options="x.ID as x.code for x in AMListData" >
</select>

</div>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {

  $scope.a={
    //SchoolDayID:'2'
  };

  $scope.selectedSchoolDayID=$scope.a.SchoolDayID || '1';//'1' is Default Value
    
  $scope.AMListData=[
    { ID: '0', code: 'PM Programming' },
    { ID: '1', code: 'AM Programming' },
    { ID: '2', code: 'Supplemental'   }
  ];
   
});
</script>

</body>
</html>