问题
I am struggling to get my little ionic app to show an SVG file in IOS using the IonicFramework.
It works in the browser and also on Android 5.0 but when I try it out in IOS my flag does not appear.
If i add the flag hardcoded into the html the flag appears as it should...
Hmm what am i doing wrong?? The example is based on a new Ionic project using the blank template...
JS snippet:
.controller('myCtrl', function($scope) {
var flag='<polygon points="0 0,0 60,120 40,120 20" fill="white" /><polygon points="0 0,24 4,24 56,0 60" fill="red" /><polygon points="48 8,72 12,72 48,48 52" fill="red" /><polygon points="96 16,120 20,120 40,96 44" fill="red" /><polygon points="0 0,0 60,120 40,120 20" fill="none" stroke="black" stroke-width="0.1" />';
$scope.myflag = flag;
});
HTML snippet:
<p>Postponed! (does not work)</p>
<svg ng-bind-html="myflag"></svg>
http://codepen.io/flemmingdjensen/pen/XbRKLV
来源:https://stackoverflow.com/questions/30682004/svg-and-ng-bind-html-is-not-working-on-ios-using-ionic-framework