I rely heavily on directives for creating and manipulating intricate SVGs. With the deprecation of "replace" in directive factories starting from version 1.3.??, I am facing a dilemma on how to construct a valid SVG without utilizing replace: true
in my directives. The structure of my directives is as follows:
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" />'
};
})
Take a look at this example Plunk showcasing two SVG directives - one with replace: true
and one without.