title: TypeError: Unable to get property 'insertBefore' of undefined or null reference only On IE
body: <p>I AngularJS v1.2.0. I am getting following error only on IE11. </p>
  
  <blockquote>
    <p>TypeError: Unable to get property 'insertBefore' of undefined or null reference at Anonymous function (/Scripts/angular.js:3850:11) at forEach (/Scripts/angular.js:303:9) at enter (/Scripts/angular.js:3849:9) at Anonymous function (/Scripts/angular.js:18725:17) at publicLinkFn (/Scripts/angular.js:5420:29) at ngRepeatAction (/Scripts/angular.js:18723:15) at $watchCollectionAction (/Scripts/angular.js:11299:11) at Scope.prototype.$digest (/Scripts/angular.js:11395:21) at Scope.prototype.$apply (/Scripts/angular.js:11634:13) at done (/Scripts/angular.js:7635:34) </p>
  </blockquote>
  
  <p>It works fine on Firefox. It fails when following custom directives executes. </p>
  
  <pre><code>.directive('appMyCourseCards', ['$compile', '$log', function ($compile, $log) {
  return {
      restrict: 'E',
      replace: true,
      scope: {
  
      },
      link: function (scope, element, attributes, controller) {            
          var content = '&lt;div class="well well-sm bottomSmallMargin" ng-repeat="schedule in studentSubjectSchedules | filterCourses:\'' + attributes.termperiodparingids + '\' "&gt;' +
                              '&lt;div class="row"&gt;' +                                    
                                          '&lt;div class="col-md-12"&gt;' +
                                              '&lt;div class="pull-left"&gt;{{schedule.SSECName}}&lt;/div&gt;' +
                                          '&lt;/div&gt;' +                                                                            
                              '&lt;/div&gt;' +
                      '&lt;/div&gt;';
  
          element.append($compile(content)(scope.$parent));
      }
  };
  </code></pre>
  
  <p>Any help would be highly appreciated.</p>
  
  <p>Thanks.  </p>