I have a PHP web app with AngularJS front end. Some of our assets are SVG format which we insert dynamically using directives.
<div ng-bind-html="block.arrow_svg | unsafe"></div>
In the code above, block.arrow_svg
is a string containing SVG code: '<svg>...</svg>' and the
unsafe` Angular filter is just a shortcut for preventing escaping of markup.
This works fine normally, but apparently Android 4.2 doesn't play nicely with inline SVG via javascript. I don't fully understand that limitation, but I'm fairly confident it is the explanation for why the assets aren't appearing on Android 4.2 devices. If I hardcode the same inline SVG code into the static page (outside the Angular template) it appears normally on Android 4.2.
Does anyone know of a workaround to allow my inline SVG to work dynamically via javascript/angular?