Я использую AngularJs v1.6.10. Мое HTML-представление содержит код:
<script type="text/ng-template" id="animation_item_renderer.html">
<g opacity="1">
<g ng-repeat="ctrl in control.controls">
<g>
<g>
<image id="{{ctrl.id}}" xlink:href="{{ctrl.imageSource}}"
animation-size-item item-width="ctrl.width"
item-height="ctrl.height"
ng-if="ctrl.getType()===2">
</image>
<rect id="{{ctrl.id}}" fill="{{ctrl.color}}" width="150"
height="20" ng-if="ctrl.getType()===1">
</rect>
</g>
</g>
</g>
<g ng-repeat="control in control.children" opacity="1"
ng-include="'animation_item_renderer.html'">
</g>
</g>
<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio="xMinYMin meet" viewBox="0,0,1000,700" style="background-color: ivory;font-size: 32px">
<g ng-repeat="control in vm.controls" ng-include="'animation_item_renderer.html'">
</g>
Когда ctrl.getType () === 2 вБраузер отображает следующий код:
<g>
<!-- ngIf: ctrl.getType()===2 -->
<!-- end ngIf: ctrl.getType()===2 -->
<!-- ngIf: ctrl.getType()===1 -->
</g>
и изображение не отображается.Кто-нибудь сталкивался с подобной проблемой?