Angular js : 如何改变点击时手风琴的颜色

Angular js : How i can change the color of accordion active on click

当我使用 ng-if 单击字形图标时,如何更改活动手风琴的颜色。我有这段代码:我无法成功做到这一点 请问你有什么想法吗?提前致谢。

style.css:

selectionAccordion {
            &:hover, &:focus {
                color: White;
               background-color:Blue;
            }
        }
        .directive('accordion', function () {
              return {
                  restrict: 'EA',
                  replace: true,
                  transclude: true,
                  template: '<div data-ng-transclude=""></div>',
                  controller: function () {
                      var Spots = [];
                      this.Open = function (selected_Spot) {
                          angular.forEach(Spots, function (Spot) {
                              if (selected_Spot != Spot)
                                  Spot.showMe = false;
                          });
                      };
                      this.addSpot = function (Spot) {
                         Spots.push(Spot);
                      };
                  }
              };
          })
          .directive('spotcam', function () {
                    return {
                        restrict: 'EA',
                        replace: true,
                        transclude: true,
                        require: '^accordion',
                        scope: { title: '@' },
                        template: '<div>' +


          '<div class="title selectedAccordionStyle ng-if="true"><a class=" more-less glyphicon glyphicon-plus" ng-class="{true: \'glyphicon glyphicon-minus\', false:\'glyphicon glyphicon-plus\'}[showMe]"  data-ng-click="toggle()"></a>{{title}}</div>' +
                    '<div class="body" data-ng-show="showMe" data-ng-transclude=""></div>' +
                        '</div>',
                        link: function (scope, element, attrs, accordionController) 
                            scope.showMe = false;
                            accordionController.addSpot(scope);
                            scope.toggle = function () {
                                scope.showMe = !scope.showMe;
                                accordionController.Open(scope);
                        } }  }
         });

感谢预支

您可以使用与嵌套 a-tag 相同的条件,检查手风琴是否由值 showMe 选择。

template: '<div>' +
          '<div class="title" ng-class="{true: \'selectedAccordionStyle\', false:\'\'}[showMe]"><a class=" more-less glyphicon glyphicon-plus" ng-class="{true: \'glyphicon glyphicon-minus\', false:\'glyphicon glyphicon-plus\'}[showMe]" data-ng-click="toggle()"></a>{{title}}</div>' +
          '<div class="body" data-ng-show="showMe" data-ng-transclude=""></div>' +
          '</div>',