Angularjs手风琴ng点击面板标题

前端之家收集整理的这篇文章主要介绍了Angularjs手风琴ng点击面板标题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在AngularJS UI Bootstrap中我想在单击面板标题时激活isopen,但我找不到方法
此版本仅在您单击链接时激活。

这是我尝试过的;

<accordion-group is-open="isopen">
    <accordion-heading ng-click="isopen=!isopen">
        I can have markup,too! 
        <i class="pull-right glyphicon" 
           ng-class="{'glyphicon-chevron-down': isopen,'glyphicon-chevron-right': !isopen}"></i>
    </accordion-heading>
    This is just some content to illustrate fancy headings.
</accordion-group>

NG-点击= “ISOPEN =!ISOPEN”

This is the link I tried on Plunker

AngularJS UI Bootstrap

提前致谢..

编辑:
更好的解决方案是将ng-click =“isopen =!isopen”移动到accordion-group元素。这样,面板打开/关闭,单击面板标题上的任何位置,包括边缘。
<accordion close-others="oneAtATime">
    <accordion-group is-open="isopen" ng-click="isopen=!isopen">
        <accordion-heading >
           I can have markup,too! 
           <i class="pull-right glyphicon" 
              ng-class="{'glyphicon-   chevron-down': isopen,'glyphicon-chevron-right': !isopen}">
           </i>
        </accordion-heading>
        This is just some content to illustrate fancy headings.
    </accordion-group>
</accordion>

结束编辑

包含< accordion-heading>的内容在< div>中

<accordion close-others="oneAtATime">
    <accordion-group is-open="isopen" >
        <accordion-heading ng-click="isopen=!isopen">
           <div>
            I can have markup,'glyphicon-chevron-right': !isopen}">
           </i>
           </div>
       </accordion-heading>
       This is just some content to illustrate fancy headings.
   </accordion-group>
</accordion>

猜你在找的Angularjs相关文章