I am using d3.js together with angularjs. When use hyperlink in svg object(which rendered through angular directive), I am getting this error.
As per the doc here, svgAnimatedString doesn't have any specific method. How can I solve this. Can I inject a method or any other way.
Part of the code below. Thanks you.
svg.selectAll("a.node")
.data(data)
.enter().append("a")
.attr("class", "node")
.attr("xlink:href", "test")
.append("rect")
If you must deal with a library which doesn't handle SVG graphics, you can use something like the following to define split on the SVGAnimatedString. Rinse and repeat for other string prototype methods.
// Set a split prototype on the SVGAnimatedString object which will return the split of the baseVal on this
// SVGAnimatedString instance
SVGAnimatedString.prototype.split = function(){ return String.prototype.split.apply(this.baseVal, arguments); };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With