title: Angular moving scope variable from controller to directive
body: <p>I have created a directive like this</p>
  
  <pre><code>  .directive('optionLabel', function() {
      'use strict';
      return {
        replace: true,
        restrict: 'AE',
        template: '&lt;div class="error-msg col-xs-12 intelligent-group col-centered"&gt;&lt;h1 translate&gt;{{ optionLabel }}&lt;/h1&gt;&lt;/div&gt;'
      };
    })
  </code></pre>
  
  <p>Right now the Scope optionLabel is set in each of the controllers that uses this directive as such.</p>
  
  <pre><code>$scope.optionLabel = labelService.getOptionLabel(search.searchType);
  </code></pre>
  
  <p>How could I set this in the directive directly, rather than doing this code repeated in like 5 controllers ?</p>