title: Issues with controller in an ng-repeat communicating data to a different controller, depending on which ng-repeat element was clicked
body: <p>I am trying to do the following:</p>
  
  <p>I have two controllers that communicate to each other via a service ( Here is my jsFiddle: <a href="http://jsfiddle.net/GeorgiAngelov/a9WLr/1/" rel="nofollow">http://jsfiddle.net/GeorgiAngelov/a9WLr/1/</a>). </p>
  
  <p><strong>The idea:</strong></p>
  
  <p>The idea is that modifying one controller will reflect in the other controller's fields, hence creating liveupdate functionality. However, current the SecondCtrl updates all 4 input fields at the same time, and vice-versa, and every single input updates all 4 the same time as well.</p>
  
  <p><strong>What I am trying to accomplish:</strong></p>
  
  <p>What I want to accomplish is the following: I want whenever I click on any of the input fields in controller one, I want it to populate the input box of controller two so then controller two can actually modify that input field that was originally clicked.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;body ng-app="project"&gt; 
      &lt;div ng-init=" data = [3,4,5,6]"&gt;
          &lt;h2&gt;{{name}}&lt;/h2&gt;
          &lt;input ng-model="thing.x"/ ng-repeat="singledata in data" ng-controller="FirstCtrl"&gt;            
      &lt;/div&gt;
  
      &lt;div ng-controller="SecondCtrl"&gt;
          &lt;h2&gt;{{name}}&lt;/h2&gt;
          &lt;input ng-model="someThing.x"/&gt;             
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var projectModule = angular.module('project',[]);
  
  projectModule.factory('theService', function() {  
      return {
          thing : {
              x : 100
          }
      };
  });
  
  function FirstCtrl($scope, theService) {
      $scope.thing = theService.thing;
      $scope.name = "First Controller";
  }
  
  function SecondCtrl($scope, theService) {   
      $scope.someThing = theService.thing; 
      $scope.name = "Second Controller!";
  }
  </code></pre>