title: How to change background color of an item based on the click in AngularJs
body: <p>I have listed a number of <code>&lt;div&gt;</code>s using ng-repeat. </p>
  
  <p>When I click on one <code>&lt;div&gt;</code> (div1) background color becomes blue, and if I click on other div (div2) - div1-background-color becomes white as it was at the beginning and div2-background-color becomes blue.<br>
  Here is my html:</p>
  
  <pre><code>&lt;div  ng-repeat="folder in vm.folders track by $index" &gt;
      &lt;span&gt;{{folder.name}}&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>