title: Re-using partials and controllers in angular
body: <p>I have two sections of a page that contain a form that are nearly identical. The only difference is some of the wording and the values of an object in the parent scope. How can I tell the view or the controller to use one scope variable instead of another?</p>
  
  <p>Contrived Example:</p>
  
  <pre><code>myApp.controller('ParentController', function($scope) {
      $scope.container = {
          someA: { a: 1, b: 3 },
          someB: { a: 2, b: 4 }
      }
  });
  
  myApp.controller('ChildController', function($scope) {
      // Some scope variable that gets the value of container.someA
      // or container.someB
  
      $scope.result = $scope.someValue.a + $scope.someValue.b;
  });
  </code></pre>
  
  <p>I could then use <code>$scope.result</code> in two child views that use the same template.</p>
  
  <pre><code>&lt;div ng-controller="ParentController"&gt;
     &lt;!-- Include #1 --&gt;
     &lt;div ng-include="someTemplate.html" ng-controller="ChildController"&gt;&lt;/div&gt;
     &lt;!-- Include #2 --&gt;
     &lt;div ng-include="someTemplate.html" ng-controller="ChildController"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I tell include #1 to use the values of <code>$scope.container.someA</code> and include #2 to use the values of <code>$scope.container.someB</code>?</p>