title: how to append a html template to a div/directive on click with angular js?
body: <p>i have this situation:</p>
  
  <pre><code>&lt;somebutton&gt;&lt;/somebutton&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>app.directive("somebutton", function(){
      return {
          restrict: "E",
  
          scope: {
            // not sure what i can do here
          },
  
          template: '&lt;button ng-click="loadTemplate()" type="button"&gt;Text&lt;/button&gt;',
  
          link: function(scope, element){
              scope.loadTemplate = function(){
  
                  //TODO: append "home.html" template inside body directive
              }
          }
      }
  });
  </code></pre>
  
  <p>...</p>
  
  <pre><code>&lt;script type="text/ng-template" id="home.html"&gt;
      &lt;div&gt;home&lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>&lt;div body &gt;&lt;/div&gt;
  </code></pre>
  
  <p>Other way of doing this could be to have the button in html instead of an template</p>
  
  <pre><code>&lt;button ng-click="loadTemplate()" type="button"&gt;Text&lt;/button&gt;
  </code></pre>
  
  <p>then maybe have a controller that has the <code>loadTemplate()</code> method that loads the template</p>
  
  <p>but im not sure how this can be done.</p>
  
  <p>Confusing? yes :)</p>
  
  <p>Any ideas on this issue?</p>
  
  <p>thanks</p>