I am trying to render a svg image with knockout, but it is not showing image after I successfully bound the viewmodel.
Here is the SVG
<svg width="500" height="500" style="border: solid 1px black">
<image id="img1" width="500" height="500"
data-bind="attr:{'xlink:href': image}"></image>
</svg>
Here is the knockout bindings,
<script>
var viewModel = function(data){
var self = this;
self.image = ko.observable(data.image)
};
var data = {image: "http://2.bp.blogspot.com/-cGeVTe2XeWU/VUEiQidIJKI/AAAAAAAACwU/UYzCrcNMMAk/s1600/comic.png"};
var vm = new viewModel(data);
ko.applyBindings(vm);
</script>
Anyway I checked the page source after executing this code. So the SVG image element in page source is
<image id="img1" width="500" height="500" data-bind="attr:{'xlink:href': image}" xlink:href="http://2.bp.blogspot.com/-cGeVTe2XeWU/VUEiQidIJKI/AAAAAAAACwU/UYzCrcNMMAk/s1600/comic.png"></image>
As you can see here, it is setting xlink:href correctly, but it is not showing on svg.
Do I need to refresh DOM somehow? Simply how can I render SVG image using knockout?
Any help will be appreciated