title: In ng-options group by selected option is not appearing
body: <p>see the image:<br>
  <a href="https://i.stack.imgur.com/tKfPe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tKfPe.png" alt="see the image"></a> I have issue while working with AngularJS ng-options, the already selected option is not showing even though ng-model have value, please can any one help me to resolve the issue. Here I am sharing my code HTML code and JavaScript code</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div data-ng-controller="skillController"&gt;
      &lt;div class="content-wrapper"&gt;
          &lt;div class="row" data-ng-if="initial" &gt;
              &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;&lt;/div&gt;
  
              &lt;div class="col-xs-9 col-sm-9 col-md-9 col-lg-9"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;Skill&lt;/div&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;&lt;/div&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;Exp In
                          years&lt;/div&gt;
                      &lt;div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"&gt;&lt;/div&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;Exp In
                          months&lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                      &lt;fieldset data-ng-repeat="choice in choices"&gt;
                          &lt;select class="col-xs-2 col-sm-2 col-md-2 col-lg-2 "
                              data-ng-model="choice.skill" data-ng-options="skills.Skill group by skills.Category for skills in skillsList"&gt;
                              &lt;option value=""&gt;Select skill&lt;/option&gt;
                              &lt;!-- &lt;option data-ng-options="skills.Skill group by skills.Category for skills in skillsList"&gt;{{skills.Skill}} --&gt;
                          &lt;/select&gt;
                          &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;&lt;/div&gt;
                          &lt;select class="col-xs-2 col-sm-2 col-md-2 col-lg-2"
                              data-ng-model="choice.years"&gt;
                              &lt;option value=""&gt;Select years&lt;/option&gt;
                              &lt;option data-ng-repeat="year in years"&gt;{{year}}&lt;/option&gt;
                          &lt;/select&gt;
                          &lt;div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"&gt;&lt;/div&gt;
                          &lt;select class="col-xs-2 col-sm-2 col-md-2 col-lg-2 "
                              data-ng-model="choice.months"&gt;
                              &lt;option value=""&gt;Select months&lt;/option&gt;
                              &lt;option data-ng-repeat="month in months"&gt;{{month}}&lt;/option&gt;
                          &lt;/select&gt;
  
                          &lt;button class="remove" data-ng-show="$last"
                              data-ng-click="removeChoice()"&gt;-&lt;/button&gt;
                          &lt;button class="add" data-ng-show="$last"
                              data-ng-click="addNewChoice()"&gt;+&lt;/button&gt;
                      &lt;/fieldset&gt;
                  &lt;/div&gt;
  
                  &lt;div class="row"&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;
                          &lt;button class="addfields" data-ng-click="submit()"&gt;Save&amp;nbsp;Changes&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;br&gt; &lt;br&gt;
  
          &lt;div class="row" data-ng-if="fildset"&gt;
              &lt;div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"&gt;&lt;/div&gt;
              &lt;div class="col-xs-9 col-sm-9 col-md-9 col-lg-9"&gt;
                  &lt;div data-ng-if="choices.length&gt;0"&gt;
  
                      &lt;table class="table table-bordered"&gt;
                          &lt;tr bgcolor="#9cc2e3"&gt;
                              &lt;th&gt;Skill&lt;/th&gt;
                              &lt;th&gt;Exp.in Years&lt;/th&gt;
                              &lt;th&gt;Exp.in Months&lt;/th&gt;
                          &lt;/tr&gt;
  
                          &lt;tbody data-ng-repeat="set in  choices "&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;{{ set .skill.Skill }}&lt;/td&gt;
                                  &lt;td&gt;{{ set .years }}&lt;/td&gt;
                                  &lt;td&gt;{{ set .months }}&lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/tbody&gt;
                      &lt;/table&gt;
                  &lt;/div&gt;
  
                  &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;
                      &lt;button class="addfields" data-ng-click="editSkills()"&gt;Edit&amp;nbsp;Skills&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
              &lt;!--  for edit --&gt;
          &lt;div class="row" data-ng-if="edit"&gt;
              &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;&lt;/div&gt;
              &lt;div class="col-xs-9 col-sm-9 col-md-9 col-lg-9"&gt;
  
  
                  &lt;div class="row"&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;Skill&lt;/div&gt;
                      &lt;div class="col-xs-3 col-sm-3 col-md-3 col-lg-3"&gt;&lt;/div&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;Exp In
                          years&lt;/div&gt;
                      &lt;div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"&gt;&lt;/div&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;Exp In
                          months&lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                      &lt;fieldset data-ng-repeat="choice in  choices track by $index"&gt;
                          &lt;select class="col-xs-2 col-sm-2 col-md-3 col-lg-2 "
                              data-ng-model="choice.skill" data-ng-options="skills.Skill group by skills.Category for skills in skillsList"&gt;
  
  
                          &lt;/select&gt;
                          &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;&lt;/div&gt;
                          &lt;select class="col-xs-2 col-sm-2 col-md-2 col-lg-2"
                              data-ng-model="choice.years"&gt;
                              &lt;option value=""&gt;Select years&lt;/option&gt;
                              &lt;option data-ng-repeat="year in years"&gt;{{year}}&lt;/option&gt;
                          &lt;/select&gt;
                          &lt;div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"&gt;&lt;/div&gt;
                          &lt;select class="col-xs-2 col-sm-2 col-md-2 col-lg-2 "
                              data-ng-model="choice.months"&gt;
                              &lt;option value=""&gt;Select months&lt;/option&gt;
                              &lt;option data-ng-repeat="month in months"&gt;{{month}}&lt;/option&gt;
                          &lt;/select&gt;
  
                          &lt;button class="remove" data-ng-show="$last"
                              data-ng-click="removeChoice()"&gt;-&lt;/button&gt;
  
                      &lt;/fieldset&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;
                          &lt;button class="addfields" data-ng-click="addNewChoice()"&gt;Add&amp;nbsp;Another&amp;nbsp;Skill&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"&gt;
                          &lt;button class="addfields" data-ng-click="submit()"&gt;Save&amp;nbsp;Changes&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript</p>
  
  <pre><code>var skill = angular.module('skillregister', [ 'shared.serviceFactory']).controller('skillController',
          function($scope, $http, serviceFactory) {
              $scope.fildset = false;
              $scope.edit = false;
              $scope.initial = true;
  
              $scope.skillsList = [];//[ "C language", "C++ language", "JAVA", "J2EE","Angular Js"]
  
  
              $scope.years = ['00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30']
  
              $scope.months = ['00','01','02','03','04','05','06','07','08','09','10','11','12']
  
              var request = serviceFactory.getPacket('getSkillList','GET');
              $http(request).success(function successCallback(response) {
  
                      $scope.skillsList = response;
  
                  console.log($scope.skillsList);
              }).error(function(data, status) {
  
              });
  
  
  
  
              $scope.choices = [{'skill': '','years': '', 'months': '' }];
  
                $scope.addNewChoice = function() {
  
                 // var newItemNo = $scope.choices.length+1;
                  $scope.choices.push({'skill': '','years': '', 'months': '' });
                };
  
                $scope.removeChoice = function() {
                  var lastItem = $scope.choices.length-1;
                  $scope.choices.splice(lastItem);
                };
  
                $scope.submit = function(){
  
                    console.log("choices----&gt;",$scope.choices);
                    var details = {
                            'skillset': $scope.choices
                    }
  
                      var request = serviceFactory.getPacket('insertSkillSet', 'POST',
                              details);
                      $http(request).success(function successCallback(response) {
  
                          $scope.response = response.result;
  
                          if ($scope.response == 'success') {
                              console.log($scope.response);
  
                              location.reload();
  
                          } else {
                              window.alert("changes update failed");
                          }
  
                      }).error(function(data, status) {
  
                      });
                }
                  var request = serviceFactory.getPacket('getSkillSet','GET');
                  $http(request).success(function successCallback(response) {
  
                      if(response!=""){
                          $scope.choices = response;
                          $scope.initial = false;
                          $scope.fildset = true;
                      }
  
                      console.log($scope.choices);
                  }).error(function(data, status) {
  
                  });
                  $scope.editSkills = function(){
                      $scope.edit = true;
                      $scope.fildset = false;
  
                  }   
          })
  </code></pre>