title: In Angular, how do I efficiently split input items into an array
body: <p>When binding input value to an ng-model like so:</p>
  
  <pre><code>&lt;input type="text" ng-model="array"&gt;
  </code></pre>
  
  <p>how do I bind the input text as an array? So if I input <code>one, two, three</code>, the resulting model will be <code>[ "one","two","three ]</code>.</p>
  
  <p>Right now this is how I'm achieving this: </p>
  
  <pre><code>&lt;input type="text" ng-model="string" ng-change="convertToArray()"&gt;
  </code></pre>
  
  <p>And in my controller: </p>
  
  <pre><code>$scope.convertToArray = function(){
      $scope.array = $scope.string.split(',');
  }
  </code></pre>
  
  <p>It works fine but I don't think it's best practice because I'm making a <code>$scope.string</code> variable and then hardcoding the destination array.</p>
  
  <p>Is it possible to just have the input's model set into array and then have the input pass through the function before being bound to the scope? </p>