title: How can I generate an array from each line of a textarea with AngularJS
body: <p>I'm attempting to create a textarea who's input is bound to a JS array where entries correspond to each line in the text area.</p>
  
  <p>I've been attempting to use <a href="http://docs.angularjs.org/api/ng/directive/ngList"><code>ngList</code></a> with it's optional parameter to specify the <em>delimiter</em>. I <em>can</em> make it work with the default (<code>,</code>) by adding a comma after each line of the textarea, but I really do not want to require that.</p>
  
  <p><strong>the textarea</strong></p>
  
  <pre><code>&lt;textarea ng-model="list"
            rows="5"
            ng-list="\n" &gt;
  &lt;/textarea&gt;
  </code></pre>
  
  <p>with the input:</p>
  
  <pre><code>test1
  test2
  test3
  </code></pre>
  
  <p>The generated output is <code>["test1\ntest2\ntest3"]</code></p>
  
  <p>What I am looking for is: <code>["test1","test2",test3"]</code></p>
  
  <p><a href="http://plnkr.co/edit/JuRsLNugiGvj4qkowAPc?p=preview"><kbd><strong>Plnkr Demo</strong></kbd></a></p>