title: Bind new html to controller after calling trustAsHtml Angularjs
body: <p>I'm able to embed the new html once received from the server but later I need to bind it to the model. Even when I compile it 5 seconds after it's inserted and displayed the html does not bind to the model.</p>
  
  <p>Let me exemplify it briefly</p>
  
  <pre><code>function coolController($scope, $http, $log, $sce, $compile, $timeout){
  $scope.message = {
          error: 'Kernel panic! :)',
          otherInfo: ''
      }
  
      $scope.form = $sce.trustAsHtml('&lt;div&gt;&lt;/div&gt;');
  
      $scope.Init = function(){
          $http({
              method: 'GET',
              url: helper.url('/form')
          }).
          success(function(data, status, headers, config) {
              $scope.form = $sce.trustAsHtml(data);
              $timeout(function(){
              $compile(angular.element('#elemThatContainsTheNewHTML'))($scope);
              }, 2500);
  
          }).
          error(function(data, status, headers, config) {
              $scope.message.error = data;            
          });
      }
  }
  </code></pre>
  
  <p>Let's assume the html is</p>
  
  <pre><code>&lt;div&gt;
  My cool error: {{ message.error }}
  &lt;/div&gt;
  </code></pre>
  
  <p>and the place where it's embedded should seem like:</p>
  
  <pre><code>&lt;div ng-controller="coolController"&gt;
      &lt;h4&gt;Hello???&lt;/h4&gt;
  
      &lt;div ng-init="Init()"&gt;
        &lt;span class="alert-error" ng-if="errorMessage.length &gt; 0"&gt;{{errorMessage}}&lt;/span&gt;
      &lt;/div&gt;
  
      &lt;div id="elemThatContainsTheNewHTML" class="viewContent" ng-bind-html="form"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The html is embedded correctly but I want to bind it to the model. </p>