title: How to reference divs by class by index in AngularJS?
body: <p>I am new to AngularJS. This is my first Plunker.</p>
  
  <p>I am trying to make it so that if a user clicks on a link in a section, the value of the link appears in the results. The other two results should be cleared of their values. </p>
  
  <p>I can't find any documentation on how to reference specific items in a class by index. In jQuery, I would normally do something like...</p>
  
  <pre><code>// get this index of the thing that was clicked
  $this = $(this),
  Idx = $BUTTONS.BigButtons.index($this),
  ThisButton.eq(Idx).doSomething();
  
  
  
  &lt;body ng-controller="MainController as main"&gt;
  
  &lt;div class="title" ng-repeat="i in [1,2,3]"&gt;
    &lt;p&gt;This is section {{i}}&lt;/p&gt;
    &lt;ul&gt;
        &lt;li ng-repeat="j in [1,2,3]"&gt;
          &lt;a href="" ng-click="main.displayContent(i, j)"&gt;section {{i}} - link {{j}}&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt; 
    &lt;div class="results" ng-bind="main.results"&gt;&lt;/div&gt;
  &lt;/div&gt; 
  &lt;/body&gt;
  
  
  var app = angular.module('controllerAsDemo', []);
  app.controller('MainController', function() {
  
  this.results = "Lame default";
  
  this.displayContent = function(firstIdx, secondIdx) {
  
  this.results = "populate section " 
    + firstIdx
    + " with the number "
    + secondIdx
    + " - other two results should be empty"
    ;
  
  };
  
  });
  </code></pre>
  
  <p>Here is the <strong><a href="https://plnkr.co/edit/IHYDNxVO4hTaBgsYooiI?p=preview" rel="nofollow">Demo</a></strong></p>