AngularJS Bootstrap手风琴是开放式的

时间:2015-09-03 12:40:11

标签: angularjs twitter-bootstrap

我试图让我的手风琴默认打开,所以我设置我的控制器:

self.groups = configuratorService.groupGarmentsByCollection(garments);
self.status = {
    open: true
};

然后在我的HTML中我有这个:

{{ garmentController.status }}

<div accordion>
    <div ng-repeat="group in garmentController.groups" accordion-group is-open="garmentController.status.open">
        <div accordion-heading>
            {{ group.label }} ({{ group.garments.length }}) <span class="pull-right fa" ng-class="{ 'fa-chevron-down': garmentController.status.open, 'fa-chevron-right': !garmentController.status.open } "></span>
        </div>

        <div class="picker garment-picker row">
            <div class="col-md-10 col-md-offset-1">
                <div class="row">
                    <div class="col-md-3" ng-repeat="garment in group.garments">
                        <a class="thumbnail" href="" ng-class="{ 'active': garmentController.matchGarment(garment) }" ng-click="garmentController.setGarment(garment)">
                            <div class="caption">
                                <p>{{ garment.title }}</p>
                            </div>
                        </a>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

由于某些原因,当我运行此功能时,顶部的状态输出显示 {“open”:false} ,当我点击手风琴标题时,没有任何反应。 有谁知道为什么这不起作用?

0 个答案:

没有答案