svg的动态模板中的角度载荷

时间:2016-07-24 20:35:16

标签: angularjs svg angularjs-ng-repeat

x。svg image =“./ img / house.svg”路径中的图形加载

问题是我无法弄清楚如何将它加载到ng-include片中?同样根据我的内容,它应该加载在include div内的<svg>标记内。关于如何让它以我想要的方式运作的任何想法?

  <div class="row graphic caption"  ng-repeat="x in myData" ng-show="item ==({{$index}})">

   <div ng-include="{{x.Graphic}}" class="ng-scope">
      <svg width="770" height="500">

      </svg>
    </div>

</div>

1 个答案:

答案 0 :(得分:0)

你不能这样做:

<div class="row graphic caption"  ng-repeat="x in myData" ng-show="item ==($index)">
    <img width="770" height="500" src="{{x.Graphic}}">
  </img>

同时检查item == $index是否导致图片无法显示 注意:    尝试使用<object data="blah blah">

要尝试的另一件事:

<svg width="770" height="500">
      {{x.Graphic}}
 </svg>