title: How can I access attribute on Angular directive from the controller?
body: <p>I have created a <strong>starred</strong> directive. On this directive I can set <code>object-class="customer"</code>.
  How can I access this attribute from the belonging controller? I want to do different things within the controller regarding which value being set as object-class.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;starred object-class="martin"&gt;&lt;/starred&gt;
  </code></pre>
  
  <p><strong>template</strong></p>
  
  <pre><code>&lt;span class="fa fa-star" ng-click="star_clicked($event)"&gt;Star&lt;/span&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>angular.module('app', [])
  .directive('starred', function() {
    return {
      restrict: 'E',
      scope: {
        objectClass: '='
      },
      templateUrl: '/templates/starred.html.slim',
      controller: function($scope, $attrs) {
        return $scope.star_clicked = function(e) {
          var id = $(e.target).closest('tr').data('customer-id');
          console.log("info: " + $attrs.objectClass);
          console.log("id: " + id);
        };
      }
    };
  });
  </code></pre>