I am writing some SVG directives that should insert svg templates. Since replace is marked as deprecated I try to use an attribute directive on a g element like here: http://stackoverflow.com/a/28281587/498298
angular.module('app', []).directive('myRect', function() {
return {
restrict: 'A',
templateNamespace: 'svg',
template: '<rect x="20" y="20" width="100" height="50" fill="blue" />'
};
})
It works in Chrome, but in IE11 the <g my-rect></g> is empty.
I'm not sure if I'm right, but I think the problem is in $compileNode.html(directiveValue); which sets innerHTML even for SVG templates. While supported in Chrome, IE seems not to support innerHTML for SVGElements.
I can fix the problem by using the same code as for replace:true case:
hansmaad@2488eed