【发布时间】:2015-04-29 13:46:13
【问题描述】:
内联 SVG 在 Firefox 和 Chrome 中运行良好。有些实例在 IE10+ 中工作,如果你运行 plunker,你会看到: http://plnkr.co/edit/CQ6HOtHxAlJd2hxoz1fa?p=preview
这是我的问题插件: http://plnkr.co/edit/09FBW7EFk99vvXlpliLL?p=preview
tl;dp(太长,没写)详细信息: 此代码适用于 IE:
<form novalidate class="simple-form">
Size: <input type="text" ng-model="size" /><br />
Pos: <input type="text" ng-model="pos" /><br />
</form>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height='400' width='400'>
<square x='0' y='5' size='50' fill='blue'/>
<rect x='{{pos}}' y='100' width='{{pos}}' height='{{size}}' fill='red'/>
</svg>
此代码在 IE 中不起作用:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 360 240" preserveAspectRatio="xMidYMid meet">
<g ng-repeat="zone in sst.zones">
<g ng-if="zone.camera == 1" transform="scale(0.5)">
<path d="M {{zone.geometry[0].x}}{{zone.geometry[0].y}}
L {{zone.geometry[1].x}} {{zone.geometry[1].y}}
{{zone.geometry[2].x}} {{zone.geometry[2].y}}
{{zone.geometry[3].x}} {{zone.geometry[3].y}} Z"
fill="none" stroke="red" stroke-width="2" />
</g>
</g>
</svg>
我注意到,当我查看渲染结果的来源时,d 属性为空,即 d=""。有什么建议吗?
编辑:两个示例之间的主要区别之一是失败的示例嵌入在正在被 ngIncluded 的模板中。
【问题讨论】:
标签: angularjs internet-explorer svg