NG-CLASS - 如果父级<a>

时间:2015-08-24 20:26:34

标签: jquery angularjs ng-class ng-show

I am using a offcanvas bootstrap/jasny nav. What I am trying to do is switch out a class on a icon based upon if the div has the "canvas-slid" on it. I was wondering if this can be done with NG-CLASS based on if a Class exist on a parent . Here is a fiddle https://jsfiddle.net/f3mgacy4/8/上的类存在,并且代码基于jQuery。 jQuery的唯一问题是当你点击它隐藏导航的任何地方时,但不会改变图标。所以我想知道你是否能用NG-CLASS做到这一点,如果不能用jQuery怎么做呢。

<a id="filterLink" data-toggle="offcanvas" data-placement="right" data-target=".filter-menu"><span id="filterIcon" class="glyphicon glyphicon-filter text-white"></span></a>

<div class="offcanvas filter-menu">
    Offcanvas fly in filter...
</div>

0 个答案:

没有答案