在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
提前致谢..
编辑:
更好的解决方案是将ng-click =“isopen =!isopen”移动到accordion-group元素。这样,面板打开/关闭,单击面板标题上的任何位置,包括边缘。
原文链接:https://www.f2er.com/angularjs/144013.html更好的解决方案是将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>