title: How to populate value in a select dropdown as default using angular js
body: <pre><code> &lt;select data-ng-model="userInf.role" class="span12" required&gt;
      &lt;option value="" selected="selected" disabled="disabled"&gt;Choose one&lt;/option&gt;
      &lt;option data-ng-repeat="role in roles" value="{{ role.text }}"&gt;{{ role.text }}&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>angular</p>
  
  <pre><code>userService.getUser($scope.userInf,
          function( data ) // success
          {
  
          $scope.userInf = {
                  username: data.userName,
                  firstname: data.firstName,
                  middlename: data.middleName,
                  lastname: data.lastName,
                  title: data.title,
                  organization: data.organization,
                  role: data.authorization.role,
                  dateOfBirth:data.dateOfBirth,
                  save: 'update'              
              };
          },
  </code></pre>
  
  <p>Other fileds are coming but select value is not coming </p>
  
  <p>In inspect element i can see</p>
  
  <pre><code>&lt;select data-ng-model="userInf.role" class="span12 ng-pristine ng-valid ng-valid-required" required=""&gt;
          &lt;option value="? string:Analyst ?"&gt;&lt;/option&gt;
          &lt;option value="" selected="selected" disabled="disabled"&gt;Choose one&lt;/option&gt;
          &lt;!-- ngRepeat: role in roles --&gt;&lt;option data-ng-repeat="role in roles" value="Analyst" class="ng-scope ng-binding"&gt;Analyst&lt;/option&gt;
          &lt;option data-ng-repeat="role in roles" value="Admin" class="ng-scope ng-binding"&gt;Admin&lt;/option&gt;
          &lt;/select&gt;
  </code></pre>