title: AngularJS - Run directives explicitly
body: <p>I'm new to AngularJS and I'm struggling with the following issue.</p>
  
  <p>I need to implement a 3 step workflow as follows:</p>
  
  <ol>
  <li><p>Make a call to a web service that returns a list of strings. For example, ["apple", "banana", "orange"], etc. I intercept the response and add the angle brackets around each of these strings before I send it to the Views.</p></li>
  <li><p>For each of the string returned by the service, I have to render </p>
  
  <pre>
  &lt;apple /&gt;
  &lt;banana /&gt;
  &lt;orange /&gt;
  </pre></li>
  <li><p>Finally, get the actual AngularJS directive corresponding to each of those strings to "execute" (not sure what the right word is) and replace the elements above with the content from the templateUrl property as mentioned in each of their respective directives.</p></li>
  </ol>
  
  <p>Right now, I'm doing Step 1 and Step 2 above using AngularJS.  But I understand that they can be done using plain JavaScript using AJAX calls. </p>
  
  <p>My problem is that the directives don't get "run" or "executed" and I have these tags displayed as <em>plain text</em> on the page - <pre>
      &lt;apple /&gt;
      &lt;banana /&gt;
      &lt;orange /&gt;
      </pre> etc.</p>
  
  <p>How do I tell Angular to replace the custom tags with the actual content from their templates?</p>
  
  <p>Thanks for your help.</p>
  
  <p>UPDATE: Here's what the code looks like:</p>
  
  <pre>
  &lt;div class="content" ng-controller="mainController"> 
  
    &lt;ul class="feeds">
  
        &lt;li ng-repeat="fruit in fruits">
  
            &lt;div ng-controller="fruitSpecificController"> {{fruit}} &lt;/div>  &lt;!--  This renders &lt;apple />, &lt;banana />, etc. -->       
  
        &lt;/li>
  
    &lt;/ul>
  
   &lt;/div>
   </pre>
  
  <p>Also note that each fruit can have its own controller. In the code above, I say "fruitSpecificController", but ideally that would also be generated at runtime. For example, "appleController", "orangeController", etc. and yes, they'll be child controllers of the parent "mainController".</p>