title: AngularJS - Refresh Directive from controller
body: <p>i've a directive that include an HTML file based on a scope variable.
  When HTML is loaded first time all is good. But when scope variable change by ng-clic i'm not able to recall directive.</p>
  
  <p>Here is my directive:</p>
  
  <pre><code>my.directive('myType', function() {
  return {
      restrict: 'A',
      replace: true,
      link: function($scope, element, attrs) {          
            var myHTML;
            if ($scope.aType==1) myHTML = "aaaa";
            if ($scope.aType==2) myHTML = "bbbb"; 
  
            $scope.contentUrl = 'library/template/tmp-' + myHTML + '.html';
      },
      template: '&lt;div ng-include="contentUrl"&gt;&lt;/div&gt;'
  }});
  </code></pre>
  
  <p>$scope.aType is scope variable that change on ng-click.
  Thanks in advance.</p>