title: Dynamic template in directive based on attributes?
body: <p>Ive seen a bunch of questions pretty similar to this, but I'm new to Angular so they aren't <em>quite</em> making sense. Here's my sitaution:</p>
  
  <p>I have a directive defined:</p>
  
  <pre><code>robus.directive("titlebar", function() {
    return {
      restrict: "E",
      scope: { title: '@title' },
      template: "&lt;header class='bar-title'&gt;&lt;h1 class='title'&gt;{{title}}&lt;/h1&gt;&lt;/header&gt;",
      replace: true
    }
  });
  </code></pre>
  
  <p>I use this directive like this:</p>
  
  <pre><code>&lt;titlebar title="{{workout.name}}"&gt;&lt;/titlebar&gt;
  </code></pre>
  
  <p>Ideally, I want to add optional attributes into this, like:</p>
  
  <pre><code>&lt;titlebar title="{{workout.name}}" editButton="true" closeButton="true"&gt;&lt;/titlebar&gt;
  </code></pre>
  
  <p>How do I handle these in the <code>template</code> definition? I've been reading about a <code>$compile()</code> function that I need to override, but haven't been clear on how to do so. The templates are just simple strings, so I feel like I can just do them inline versus referencing them as separate files.</p>
  
  <p>Thanks!</p>