title: Do event handlers need to be removed on directives when $destroy fires?
body: <p>I've seen a lot of directive examples including those by the <a href="http://angular-ui.github.io/" rel="noreferrer">AngularUI team</a> where they don't appear to do any cleanup.</p>
  <p>Here's an example from their ui-date directive which creates a jQuery datepicker.
  <a href="https://github.com/angular-ui/ui-date/blob/master/src/date.js" rel="noreferrer">(source)</a></p>
  <pre><code>element.on('blur', function() { ... });
  </code></pre>
  <p>They placed an event handler on the element, but at no point do they ever unbind the event. I would have expected there to be code present such as:</p>
  <pre><code>var namespace = &quot;.uiDate&quot;;
  
  element.on('blur' + namespace, function() { ... });
  element.on(&quot;$destroy&quot; + namespace, function ()
  {
     element.datepicker(&quot;destroy&quot;);      //Destroy datepicker widget
     element.off(namespace);             //Unbind events from this namespace
  });
  </code></pre>
  <p>So this makes me wonder if there's something I don't understand. Wouldn't what they are doing cause a memory leak in situations where the element w/ this directive is created and destroyed over and over?</p>
  <p>What am I missing?</p>