title: adding and removing classes in angularJs using ng-click
body: <p>I am trying to work how to add a class with ngClick. I have uploaded up my code onto plunker <a href="http://plnkr.co/edit/YRzOYU3gIBa1OfGOBSA0?p=preview">Click here</a>. Looking at the angular documentation i can't figure out the exact way it should be done. Below is a snippet of my code. Can someone guide me in the right direction</p>
  
  <pre><code> &lt;div ng-show="isVisible" ng-class="{'selected': $index==selectedIndex}" class="block"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>var app = angular.module("MyApp", []);
  app.controller("subNavController", function ($scope){
  
          $scope.toggle = function (){
              $scope.isVisible = ! $scope.isVisible;
          };
  
          $scope.isVisible = false;
      });
  </code></pre>