title: How to add and remove class with AngularJS?
body: <p>I have a few buttons that work like switchers. If you click one it becomes active and "shuts down" other buttons. I did this using jQuery but would like to use AngularJS. Here is my code:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="button-bar"&gt;
      &lt;a class="button button-energized" id="weak"&gt;weak&lt;/a&gt;
      &lt;a class="button button-energized" id="normal"&gt;normal&lt;/a&gt;
      &lt;a class="button button-energized" id="strong"&gt;strong&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JavaScript</strong></p>
  
  <pre><code>    .controller('AppCtrl', function($scope, $stateParams) {
  
          $('#weak').click(function() {
              $('#weak').addClass('active');
              $('#normal').removeClass('active');
              $('#strong').removeClass('active');
          });
  
          $('#normal').click(function() {
              $('#normal').addClass('active');
              $('#weak').removeClass('active');
              $('#strong').removeClass('active');
          });
  
          $('#strong').click(function() {
              $('#strong').addClass('active');
              $('#normal').removeClass('active');
              $('#weak').removeClass('active');
          });
  
     });
  </code></pre>