title: AngularJS Custom Directive Access attributes in Template while inheriting parent scope
body: <p>I have a custom directive that I would like to inherit the parent scope. I would also like to pass a value via an attribute. It looks like this:</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>app.controller('Main', ['$scope', function($scope){
     $scope.cols = { 'col1': true, 'col2':false, 'col3': true};
  
     $scope.toggleCol = function(colName){
         $scope.cols[colName] = !$scope.cols[colName];
     };
  }]);
  </code></pre>
  
  <p><strong>Directive</strong></p>
  
  <pre><code>wrApp.directive("custTh", function(){
   return {
      restrict: "EA",
      scope: false,
      replace: true,
      template: '&lt;th ng-show="cols[{{ colname }}]" ng-click="toggleCol({{ colname }})"&gt;{{ colname }}&lt;/th&gt;',
  
   };
  });
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;th cust-th colname="col2"&gt;&lt;/th&gt;
  </code></pre>
  
  <p>I just can't seem to get access to the attribute value bc I am inheriting the parent scope. Is it possible to directly access directive attributes from the template? </p>