title: AngularJS cloned element in directive (with no controller) calls function from controller twice
body: <p>I wrote a directive to fix the header of the table to top on scroll. It works fine. Table is also sortable. When user clicks to the header of a column, list is sorting by that column and when user clicks active column, sorting is reversed. Everything works as I expected. But when I clicked to fixed header, sort function gets called twice (you can see it in the console).</p>
  <p>I can't find the source of the problem and how to solve it. Here's my <a href="http://plnkr.co/edit/EMmvEvLt2hV6PDXpWOzp?p=preview" rel="nofollow noreferrer">plunkr</a>. Thanks in advance for any help...</p>
  <p>Btw, if I remove the compiling codes (</p>
  <pre><code>var linkFn = $compile(fixedHeader);
  linkFn(scope);
  </code></pre>
  <p>), it works fine. But then ng-class does not apply, because i think it can not access to the controller variables.</p>
  <p><strong>Edit:</strong></p>
  <p>I've updated the <a href="http://plnkr.co/edit/EMmvEvLt2hV6PDXpWOzp?p=preview" rel="nofollow noreferrer">plunkr</a> to show my problem with ng-class when I delete compiling codes.</p>