title: How to pass a ng-repeat variable in ng-if?
body: <p>I have ng-repeat in first line of code , in the next line I need to create a dynamic variable based on what I get in ng-repeat.</p>
  
  <p>code would look something like this:</p>
  
  <pre><code>&lt;div ng-repeat="head in arrayofhead"&gt;
    &lt;span ng-if="canIbecreated_{{head}}"&gt;I am created!!&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>where </p>
  
  <pre><code>arrayofhead = ["1","2","3"];
  </code></pre>
  
  <p>but this produces an error while similarly I can pass {{$index}} in this easily.</p>
  
  <p>Why this ditching is present in Angularjs?</p>
  
  <p>on Controller I would do </p>
  
  <pre><code>var canIbecreated_1="false";
  var canIbecreated_2="true";
  var canIbecreated_3="false";
  </code></pre>
  
  <p>To crate and not to create the span.</p>