I'm trying to get a click event on a SVG
to fire using knockout.js:
HTML
<img id="the-image" src="img/image.svg" data-bind="????????" />
SVG
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="100" fill="#707070"
width="20"
height="200"
data-bind="click: $root.open" />
</svg>
this doesn't work if the SVG
file is given as source for the img
element, it does however work if I just paste it into the img
element.
Is there a way to setup the binding so that the data-context is accessible for the SVG
?