title: Creating a list and rendering with angular directives
body: <p>I am doing a learning project for the MEAN stack, and I am really stuck at something which I need help.</p>
  
  <p>On the real project, what I do is I have a Form creator were different components can be created and arranged according to the user needs, then directives similar to the used on this simplified example renders the from component by component and enable the user to populate it.</p>
  
  <p>On this <a href="https://jsfiddle.net/GabrielBarcia/hfj70d4k/" rel="nofollow">JSFiddle</a>, as I mentioned, there is a simplified version where I use a similar approach to the one I want to use on my project.</p>
  
  <p>My Logic is: I create a new array where all the values I input on the textbox  are stored after a small processing on the format, then I have two directives that have access to a factory function where the data is stored, that loop trough all the items and render them one by one.</p>
  
  <p>I can see that the factory function is working and create the set of data as I wanted to be.</p>
  
  <p>Here is where the problems start:</p>
  
  <p>I call the directive like this</p>
  
  <pre><code>&lt;render-all-items&gt;&lt;/render-all-items&gt;
  </code></pre>
  
  <p>the definition of this directive is</p>
  
  <pre><code>.directive('renderAllItems', function (DataServ) {
      return {
          restrict: 'E',
          scope: {},
          link: function (scope, elem, attrs) {
              scope.values = DataServ.currentTemplate.getAllItems();
          },
          template: '&lt;div ng-repeat="item in values"&gt;{{item}}&lt;render-item render="item"&gt;&lt;/renderItem&gt;&lt;/div&gt;'
      };
  });
  </code></pre>
  
  <p>This directive supposedly iterates the list of elements and render them one by one. The single Item render is working after a initial typo correction.</p>
  
  <p>The output on the modal is:</p>
  
  <pre><code>[[
  Item order = and item value =
  
  ]]
  Item order = and item value =
  </code></pre>
  
  <p>And is always the same output, no matter how many items are on the array.</p>
  
  <p>My main goal is easy:
  I should be able to add as many items I want using the textbox and then when I press the open modal, I should be able to see the list of elements rendered in the modal dialog.</p>
  
  <p>I would really appreciate guidance on where I am doing it wrong to achieve the result I want.</p>
  
  <p>Thanks in advance.</p>