1
votes

Running an AngularJS directive, with the transclude option, in the link function the transclude() function will not return any Clone in IE8. It's working properly for IE9

HTML

<div data-ng-app="fooApp">
    <foo>
        <span>(content to transclude)</span>
    </foo>
</div>

JS

var app = angular.module('fooApp', []);

app.directive('foo', [function () {
      return {
        restrict: 'E',
        replace: true,
        transclude: true,
        link: function (scope, element, attrs, ctrl, transclude) {
            console.log(transclude())
        }  
      }  
}]);

http://plnkr.co/edit/osOY27AUcRSO7QyfRsP9?p=preview

any idea?

1

1 Answers

1
votes

IE8 doesn't support the custom elements you need to use your directive as Attribute the make it working with IE8 compatible.

restrict: 'AE'

Same SO Answer Here