title: ng-bind-html and ng-model together in select dropdown
body: <p>I have JSON file as below</p>
  
  <pre><code>var LocationList = [
  {"id":1,"value":"ABC"},
  {"id":2,"value":"XYZ"},
  .
  .
  .
  ]
  </code></pre>
  
  <p>I'm trying to dynamically populate dropdown on my HTML as below</p>
  
  <p>Angular Code:
  .factory('locationService', function($filter){</p>
  
  <pre><code>     var Location = {};
       Location.Template = "";
  
       Location.getLocation = function(){
  
          var template = '&lt;option direction="ltr" value="" id="theOption2"&gt;' + $filter('translate')('lSummary_Location_text') + '&lt;/option&gt;';
  
          LocationList.forEach(function(loc){
                           var value = loc.value + ' / ID: ' + loc.id;
                           template += '&lt;option direction="ltr" value="' + value + '"&gt;' + loc.value + '&lt;/option&gt;';
                        });
  
          Location.Template = template;
       },
       Location.getTemplate = function(){
          return Location.Template;
       }
  
       return Location;
  
       })
  
  .controller('secondInfoCtrl',function($scope, locationService, $sce){
  $scope.locationList =$sce.trustAsHtml(locationService.getTemplate());
  
  //RETURNS THE DATA FROM LOCAL STORAGE  
  $scope.Location = SecondScreenService.getInfo();
  })
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;select id="location" ng-model="Location.location" ng-bind-html="locationList"&gt;&lt;/select&gt;
  </code></pre>
  
  <p>Problem:
  When I select an option from dropdown and move to next page and come back again to same page, ng-model is not working. Expected behavior is that the dropdown should be set to the value selected by the user, but the dropdown shows 1 option as selected.</p>
  
  <p>If I'm not wrong, ng-model runs before ng-bind-html, so if the dropdown is not populated how the value will be selected.</p>
  
  <p>Is there any way to delay ng-model, so that the list gets populate first and binding happens after that.</p>
  
  <p>May I know where I'm going wrong.</p>
  
  <p>Thanks in advance </p>