title: How do I set default value of select box in directive
body: <p>I have some trouble with my directive. I load the data about a user in which role it is.  I want to do that when loading controller is selected which is attached to the user's role. I try to initialize with <code>scope.SelectedValue</code>, but something don't work, or i need to do in another way.</p>
  
  <pre><code>var app = angular.module('app');
  
  app.directive('roleDirective', ['userRepository', function (userRepository) {
      return {
          restrict: 'E',
          template: '&lt;select id="roles" ng-model="SelectedValue" ng-change="Change()"&gt;' +
                          '&lt;option ng-repeat="role in Roles" value="{{role.RoleId}}"&gt;{{role.RoleName}}' +
                          '&lt;/option&gt;' +
                    '&lt;/select&gt;',
               link: function (scope, elem, attrs) {
  
              if (scope.User.webpages_Roles.length &gt; 0) {
                  scope.SelectedValue = scope.User.webpages_Roles[0].RoleId;
              }
  
          }
      }
  }]);
  </code></pre>