title: Add "A"-directive to parent node and execute
body: <p>I'm a newbie in Angular.js and I stuck with one problem.</p>
  
  <p>I want to integrate this plugin (<a href="https://github.com/pratyushmittal/angular-dragtable" rel="nofollow noreferrer">https://github.com/pratyushmittal/angular-dragtable</a>) to be able to drag columns in my table.<br>
  The whole table is a directive. Each <code>&lt;th&gt;</code> also renders by a directive.</p>
  
  <pre><code>   &lt;table&gt;
       &lt;thead&gt;
         &lt;tr&gt;
           &lt;th ng-repeat="col in table.columns" my-column&gt;&lt;/th&gt;
         &lt;/tr&gt;
       &lt;/thead&gt;
     &lt;/table&gt;
  </code></pre>
  
  <p>According to plugin documentation I need to set <strong>draggable</strong> directive to table. If I set it manually it doesn't grab my columns properly, because this columns is not rendered at that moment, and this doen't work. In <strong>my-column</strong> directive I'm waiting for last <strong>&lt; th ></strong> </p>
  
  <pre><code>.directive('myColumn', ['$timeout', function($timeout) {
    return {
      restrict: 'A',
      templateUrl: 'templates/column.html',
      link: function(scope, element, attrs) {
        if (scope.$last)
          $timeout(function() {
              //scope.$emit('lgColumnsRendered');
              angular.element(element).closest('table').attr('draggable', 'draggable');
          });
      }
    }
  }])
  </code></pre>
  
  <p>And when last th is rendered I going up to my table and set this directive. For sure it is stupid and doesn't work. I also read about <code>$compile</code> but I need add attribute-directive to already existing table in my DOM.</p>
  
  <p>Maybe I go wrong way and don't understand concept of doing this, but you catch the idea? How can I do this? </p>