I am trying to implement SVG diagram in an Aurelia V2 application but having trouble creating the SVG from the view. I have created a very small project to validate that my problem is not related to other parts of the bigger application. When I put an SVG element on the view and attempt to output anything with a “.bind” I am getting an error that the value I am attempting to bind to only has a getter without a setter. This is similar to the issue I was having previously but I think this is probably more related to the templating engine as I can create a very simple example - see below
<svg width="1000" height="800">
<g transform='translate(${100},100)'></g>
</svg>
Error: Uncaught (in promise) TypeError: Cannot set property transform of # which has only a getter
Stack: at PropertyAccessor.setValue (index.js?41e8:4951)
at InterpolationBinding.updateTarget (index.js?15fa:1582)
at InterpolationBinding.$bind (index.js?15fa:1598)
at Controller.bind (index.js?15fa:4002)
at Controller.activate (index.js?15fa:3983)
at ComponentAgent.activate (index.js?5020:3840)
at eval (index.js?5020:1035)
at Transition.run (index.js?5020:2799)
at eval (index.js?5020:1033)
at Batch.invoke (index.js?5020:36)
The same holds true if the binding is done with a .bind on any property. I tried this on a rect for the x and y too but got the same problem. I have found some posts related to doing SVG but I don’t think I have seen anything with V2. I did apply some of the techniques in the other posts but there was still trouble any time I tried to bind a property. I tried this in V1 and the same simple code above is able to execute without any issues so it seems to be a V2 difference.
I created a gist for this at Dumber Gist
Perhaps there is a configuration or some other technique to enable the initialization of the attribute.
–Paul