title: angularjs default select always changes
body: <p>with <code>angularjs</code> select tab and <code>ng-options</code>,I cannot get the right default <code>selecedValue</code> after I selected one .</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;select ng-model="selectedStyle" ng-options="style as style.name for style in styles"&gt;&lt;/select&gt;
  </code></pre>
  
  <p><strong>javascript</strong></p>
  
  <pre><code> $scope.$on('openStyleList', function (event, page) {
  
  
                  styleListService.Get().
                  then(function (data) {
                      var tempArray = new Array();
                      if(page.pageType == 'Jacket')
                      {
                          tempArray.push(_.first(data))
                          $scope.styles = tempArray;
                          alert($scope.styles[0].name)//here i get the first one
                          $scope.selectedStyle = $scope.styles[0];//but here the $scope.selectedStyle is not always the first one! It's always the one that I selected before.I cannot set it to the default one($scope.styles[0])
                      }
                      else if (page.pageType == 'Body') {
                          if (_.rest(data).length == 1) {
                              tempArray.push(_.rest(data))
                              $scope.styles = tempArray;
                          }
                          else {
                              $scope.styles = _.rest(data);
                          }
                          alert($scope.styles[0].name)//aslo here
                          $scope.selectedStyle = $scope.styles[0];//aslo here
                      }
  
                  });
  
              })
  </code></pre>
  
  <p>the styleListService code:</p>
  
  <pre><code>angular.module('editorApp')
    .service('styleListService', ['$http', '$log', '$q', '$timeout', '$window', 'baseService', 'settings',
        function styleListService($http, $log, $q, $timeout, $window, baseService, settings) {
  
            var StyleListServiceFactory = {};
  
            var _get = function () {
  
                return baseService.get('styles/');
  
            }
            StyleListServiceFactory.Get = _get
  
            return StyleListServiceFactory;
    }]);
  </code></pre>
  
  <p>the part of baseService code :</p>
  
  <pre><code>var _get = function (apiPath, responsetype) {
  
      var deferred = $q.defer();
  
      if (responsetype == undefined)
      {
          responsetype = "";
      }
  
      $http.defaults.cache = false;
  
      $http.get(settings.baseUrl + apiPath,
          {
              headers: {
                  'Accept': 'application/json',
                  'Content-Type': 'application/json'
              },
              responseType: responsetype
  
          }).success(function (response) {
  
              deferred.resolve(response);
  
          }).error(function (data, status, headers, config) {
  
              deferred.reject(status);
  
          });
  
      return deferred.promise;
  }
  
  baseServiceBaseFactory.get = _get;
  </code></pre>