Javascript 引导,在ng repeat中切换数据,默认打开和/或绑定打开到数据
所以我有一些引导html,我正试图集成到我的angular应用程序中。我正在对输入的一些数据执行重复操作,并尝试将其集成到这个逻辑中,因此我基本上只是尝试默认打开选项卡,如果可能,将它们标记为布尔值 这里是htmlJavascript 引导,在ng repeat中切换数据,默认打开和/或绑定打开到数据,javascript,html,angularjs,twitter-bootstrap,Javascript,Html,Angularjs,Twitter Bootstrap,所以我有一些引导html,我正试图集成到我的angular应用程序中。我正在对输入的一些数据执行重复操作,并尝试将其集成到这个逻辑中,因此我基本上只是尝试默认打开选项卡,如果可能,将它们标记为布尔值 这里是html <div> <a data-toggle="collapse" ng-href="#{{filter.name}}" aria-expanded="true" > <h4>{{filter.name}}<i class="fa fa-
<div>
<a data-toggle="collapse" ng-href="#{{filter.name}}" aria-expanded="true" >
<h4>{{filter.name}}<i class="fa fa-angle-right"></i></h4>
</a>
<div class="collapse col-xs-12" id="{{filter.name}}">
<div ng-repeat="item in filter.values track by $index" class="result-filter-value" value="item" update-filter="updateFilter">
</div>
</div>
如果选中该项,则该布尔值将返回。不幸的是,我现在没有插入引导ui的奢侈,所以我想知道是否有一种快速简便的方法来解决这个问题,主要是将所有的切换默认打开。谢谢 我不知道你到底想要什么,但要用项目切换div的可见性,你可以这样做
<div>
<a data-toggle="collapse" ng-href="#{{filter.name}}" aria-expanded="true" ng-click="filter.showItems = !filter.showItems">
<h4>{{filter.name}}<i class="fa fa-angle-right"></i></h4>
</a>
<div class="collapse col-xs-12" id="{{filter.name}}" ng-show="filter.showItems">
<div ng-repeat="item in filter.values track by $index" class="result-filter-value" value="item" update-filter="updateFilter">
</div>
</div>
</div>
你是在谈论制表符还是手风琴?@DavidGrinbergaccordions@DavidGrinberg正如我所提到的,我不能在这个项目中使用bootstrap ui,这将在一次重复中中断-它将打开所有的界面,所以只需迭代您的过滤器并将showItems属性添加到每个。。然后切换该属性我正在尝试使用的功能已经显示并隐藏了,而不是重新创建。这就是我所说的它会破裂的意思。这会弄乱我正在使用的手风琴逻辑的引导。这完全绕过了引导,我正试图使用它。
<div>
<a data-toggle="collapse" ng-href="#{{filter.name}}" aria-expanded="true" ng-click="filter.showItems = !filter.showItems">
<h4>{{filter.name}}<i class="fa fa-angle-right"></i></h4>
</a>
<div class="collapse col-xs-12" id="{{filter.name}}" ng-show="filter.showItems">
<div ng-repeat="item in filter.values track by $index" class="result-filter-value" value="item" update-filter="updateFilter">
</div>
</div>
</div>