title: Reload a directive on controller event
body: <p>I have a directive which is fetching data through ajax on load. But after an event in the controller which is posting some data, the Directive should re-compile with the new ajax data so that the changes can be reflected. Can you please help.</p>
  
  <p>I have a compile function in the directive which takes data and puts that in HTML file and generates markup.</p>
  
  <p>Then I have a save comment function in the controller which saves a new comment and so the directive gets the new data.</p>
  
  <pre><code>compile: function(tElement, tAttrs) {
        var templateLoader = $http.get(base_url + 'test?ticket=' + $routeParams.ticketid, {cache: $templateCache})
            .success(function(htmlComment) {
              if (htmlComment != '')
                tElement.html(htmlComment);
              else
                tElement.html('');
            });
        return function (scope, element, attrs) {
          templateLoader.then(function (templateText) {
            if (tElement.html() != '')
              element.html($compile(tElement.html())(scope));
            else
              element.html('&lt;div class="no-comments comment"&gt;&lt;p&gt;Be the first to comment&lt;/p&gt;&lt;/div&gt;');
          });
        };
      }
  </code></pre>
  
  <p>This is the compile part of the directive. I want this to be called through a normal controller event.</p>