I use a lot of directives to draw and manipulate a complex SVG.
Since 1.3.?? the use of "replace" in directive factories is deprecated. I wonder how I should build a valid SVG without using replace: true
in my directives. My directives look like this:
angular.module('app', []).directive('myRect', function() {
return {
restrict: 'E',
replace: true,
templateNamespace: 'svg',
template: '<rect x="20" y="20" width="100" height="50" fill="blue" />'
};
})
See this plunk for an example of two SVG directives, one using replace: true
and one not.