title: Toggling accordion panel icons with ng-class and ng-click
body: <p>I have an accordion with "chevron" icons that are toggled to point up or down when clicked, this is done with <code>ng-click</code> and <code>ng-class</code>. The accordion only permits one panel to be open at the same time - so when I click on a panel that is closed, the panel that is open closes. But how do I toggle the chevron icon on the open panel that is getting closed with <code>ng-click</code>? </p>
  
  <p>Originally i could do it with DOM manipulation etc, but since this is a partial view in angular I  cannot do it.</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;div class="panel-group" id="accordion"&gt;
    &lt;div class="panel panel-default"&gt;
      &lt;div class="panel-heading"&gt;
        &lt;h4 class="panel-title"&gt;
          &lt;a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" ng-click="firstpaneisopen=!firstpaneisopen"&gt;
             &lt;i class="glyphicon" ng-class="{'glyphicon-chevron-up': firstpaneisopen, 'glyphicon-chevron-down': !firstpaneisopen}"&gt;&lt;/i&gt; Collapsible Group Item #1
           &lt;/a&gt;
        &lt;/h4&gt;
       &lt;/div&gt;
      &lt;div id="collapseOne" class="panel-collapse collapse in"&gt;
       &lt;div class="panel-body"&gt;
         Body
       &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="panel panel-default"&gt;
     &lt;div class="panel-heading"&gt;
       &lt;h4 class="panel-title"&gt;
         &lt;a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" ng-click="secondpaneisopen=!secondpaneisopen&gt;
           &lt;i class="glyphicon" ng-class="{'glyphicon-chevron-up': secondpaneisopen, 'glyphicon-chevron-down': !secondpaneisopen}"&gt;&lt;/i&gt; Collapsible Group Item #2
         &lt;/a&gt;
       &lt;/h4&gt;
      &lt;/div&gt;
      &lt;div id="collapseTwo" class="panel-collapse collapse"&gt;
       &lt;div class="panel-body"&gt;
         Body
       &lt;/div&gt;
      &lt;/div&gt;
     &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>