title: AngularJS create partial template with parameter
body: <p>I have gone through below <a href="http://stackoverflow.com">SO</a> questions to get what I want. </p>
  
  <p><a href="https://stackoverflow.com/q/12577378/1184435">create a single html view for multiple partial views in angularjs</a></p>
  
  <p><a href="https://stackoverflow.com/q/36494842/1184435">Partial views in AngularJS</a></p>
  
  <p><a href="https://stackoverflow.com/q/22329769/1184435">AngularJs Include Partial Template</a></p>
  
  <p><a href="https://stackoverflow.com/q/20882122/1184435">angularjs partial template with specific scope</a> - looks close to what I want.</p>
  
  <p>But I believe my case is different from all of them. Hence, the question.</p>
  
  <p>I have got this <code>HTML</code> structure which needs to be repeated numerous times.</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;
          Enitity1
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="entity1" value="option1" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="entity1" value="option2" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="entity1" value="option3" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="entity1" value="option4" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="entity1" value="option5" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I want to pass the name of the Entity as a parameter and render this HTML template based on the parameter.</p>
  
  <p>I have created a template like below.</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;
          {{entity}}
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="{{entity}}" value="option1" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="{{entity}}" value="option2" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="{{entity}}" value="option3" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="{{entity}}" value="option4" /&gt;
      &lt;/td&gt;
      &lt;td&gt;
          &lt;input type="radio" name="{{entity}}" value="option5" /&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>My controller</p>
  
  <pre><code>app.controller("entitiesController", ["$scope",
      function entitiesController($scope) {
          $scope.init = function init(entity) {
              $scope.entity= entity;
          };
      }
  ]); 
  </code></pre>
  
  <p>And I am trying to render the same for multiple entities as below inside a <code>&lt;tbody&gt;</code> element.</p>
  
  <pre><code>&lt;ng-include src="Common/entities.html" ng-controller="entitiesController" ng-init="init('Entity1')"&gt;&lt;/ng-include&gt;
  &lt;ng-include src="Common/entities.html" ng-controller="entitiesController" ng-init="init('Entity2')"&gt;&lt;/ng-include&gt;
  &lt;!-- Some more entities here...--&gt;
  </code></pre>
  
  <p>But it does not work. It does not throw any error as well in the console.</p>
  
  <p>How do I go about this? What is the proper way of handling this? Is it possible to handle it with a template or should I just put HTML for all the entities manually?</p>