【问题标题】:How to toggle svg elements using AngularJS如何使用 AngularJS 切换 svg 元素
【发布时间】:2016-12-17 21:37:30
【问题描述】:

我需要在使用ng-include 指令插入的两个svg 之间切换。

基本上,我想改变这个:

<i class="indicator oppcicon {{domain.show_requests ? 'icon-chevron-down' : 'icon-chevron-right'}}"></i>

在这样的情况下:

<i ng-include class="indicator" src="{{domain.show_requests ? 'images/chevron-down.svg' : 'images/chevron-right.svg'}}" ></i>

这可能吗?

【问题讨论】:

    标签: angularjs svg


    【解决方案1】:

    我找到了解决办法:

    <i class="indicator" ng-include="domain.show_requests ? 'images/chevron-down.svg' : 'images/chevron-right.svg'" ></i>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-26
      • 2012-11-16
      • 1970-01-01
      • 1970-01-01
      • 2017-03-31
      • 2018-01-09
      • 1970-01-01
      • 2016-06-16
      相关资源
      最近更新 更多