简体   繁体   English

Status.Open 在 Angular UI 引导手风琴中不返回任何值

[英]Status.Open not returning any value in Angular UI bootstrap Accordion

I am facing an issue with accordion of angular ui bootstrap.我正面临 angular ui bootstrap 的手风琴问题。 I am using accordion to show FAQs in my application.Now issue is "status.open" is not returning any value due to which 'chevron icon' class is not toggling.我正在使用手风琴在我的应用程序中显示常见问题解答。现在的问题是“status.open”没有返回任何值,因为“人字形图标”类没有切换。

Please see below code:请看下面的代码:

 <div>
 <accordion close-others="true">
   <accordion-group ng-repeat="faq in FAQs">
    <accordion-heading>
    <div>
       {{faq.title}}<i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-up': status.open, 'glyphicon-chevron-down': !status.open}"></i>
    </div>
    </accordion-heading>
    <div  ng-bind-html="faq.description"></div>
        </accordion-group>
</accordion>
</div>

I am using accordion through my own app and controller.我正在通过我自己的应用程序和控制器使用手风琴。

function ($scope, FAQService) {
         $scope.FAQs = [];
          $scope.GetFAQByCategory = function() {
            $scope.response = '';
            var responsePromise = FAQService.GetFAQs();
            responsePromise.then(function(faqData) {
            $(faqData).each(function(index, key) {
                     $scope.FAQs.push(
                     {
                     title: faqData[index].Title,
                     description: faqData[index].Description, 
                     category: faqData[index].Category.Label 
                     }); 
                    } );                             
            });
             if (!$scope.$root.$$phase) {
                    $scope.$apply();
                }
        };

I found solution of my problem :).我找到了我的问题的解决方案:)。 Added添加

is-open="this.open" is-open="this.open"

<accordion-group ng-repeat="faq in FAQs" is-open="this.open" > <accordion-group ng-repeat="faq in FAQs" is-open="this.open" >

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM