title: select first element in angularjs ng-repeat
body: <p>I have a ng-repeat populating li tag. I want by default first element should be clicked and a function should be fired. how can I do this using ng-repeated. I tried ng-if and ng-switch. but other than first element rest are not getting populated.</p>
  
  <p>html:</p>
  
  <pre><code>&lt;ul id = "colors"&gt;
      &lt;li ng-repeat="color in colors | filter:query" &gt;
          &lt;div style="background-color : {{color.color}}; height : 20px; width : 20px;" ng-if = '$first' ng-click="getViewsByColors(color)"&gt;
          &lt;/div&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>