title: ng-select with lazy population
body: <p>It's an edit form with parent record first populated then dependent select list is populated, and then it's expected the value from parent record pre-select the combo box.</p>
  
  <p>html </p>
  
  <pre><code>&lt;select ng-model="data.trackId" &gt;
      &lt;option ng-repeat="track in tracks" value="{{track.id}}"&gt;{{track.name}}&lt;/option&gt;
  </code></pre>
  
  <p></p>
  
  <p>initial result once parent record is pulled.</p>
  
  <pre><code>if(data) {
              this.$scope.data.id = data.id;
              this.$scope.data.name = data.name;
              this.$scope.data.room = data.room;
              this.$scope.data.start = data.start;
              this.$scope.data.end = data.end;
              this.$scope.data.dayId = data.day_id;
              this.$scope.data.trackId = data.track_id;
              this.$scope.data.color = data.color;
              this.$scope.data.description = data.description;
              this.$scope.$apply();
              this.$element[0].removeAttribute("style");
          }
  </code></pre>
  
  <p>//later track results were pulled</p>
  
  <pre><code>trackResult: function(data, status, headers, config) {
      for(var i=0; i&lt;data.length; i++) {
          this.$scope.tracks.push(data[i]);
      }
      this.$scope.$apply();
  },
  </code></pre>
  
  <p>Problem:</p>
  
  <p>List gets populated from the second call <code>trackResult</code> but default value from the $scope.trackId never sets the combo box to a value.</p>
  
  <p>Edit: Controller Body</p>
  
  <pre><code>controller: function($scope, $element) {
      var self = this;
      this.$scope = $scope;
      this.$element = $element;
      this.$scope.data = {};
      this.$scope.days = [];
      this.$scope.tracks = [];
      this.$scope.submit = function() {self.submit()};
      this.$scope.cancel = function() {self.cancel()};
  },
  </code></pre>