title: Set ng-selected in angular-ui select
body: <p>My HTML code:</p>
  
  <pre><code>&lt;div class="form-group col-md-4"&gt;
        &lt;label for="lenderBusinessState"&gt;Select State&lt;/label&gt;
        &lt;div class="input-group select2-bootstrap-append"&gt;
  
          &lt;ui-select name="lenderBusinessState" ng-model="lenderInfo.modelState.selected" theme="select2" class="form-control"&gt;
            &lt;match placeholder="Select Lender State"&gt;{{$select.selected.stateName}}&lt;/match&gt;
            &lt;choices repeat="state in states | filter: $select.search"&gt;
              &lt;span ng-bind-html="state.stateName | highlight: $select.search" ng-selected="selectState(state.stateId)"&gt;&lt;/span&gt;
            &lt;/choices&gt;
          &lt;/ui-select&gt;
  
          &lt;span class="input-group-btn"&gt;
            &lt;button type="button" ng-click="lenderInfo.modelState.selected = undefined" class="btn btn-danger"&gt;
              &lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;
            &lt;/button&gt;
          &lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My JS code:</p>
  
  <pre><code>$scope.selectState = function(stateIdPassed)
  {
      console.log(stateIdPassed);
      if(stateIdPassed == $scope.stateId){
          return 'selected';
      }
  }
  </code></pre>
  
  <p>I want to prefill my ui-select input. I am using <a href="https://github.com/angular-ui/ui-select" rel="nofollow">ui-select</a>. If i don't use ui-select input and just use  tags, then its working. But, not with  tags.</p>
  
  <p>What are the possible solutions? Please help me out as i have used  in my application.</p>