title: how to use split in angularjs
body: <p>im get date for ng-model like that</p>
  
  <blockquote>
    <p>Thu May 21 2015 18:47:07 GMT+0700 (SE Asia Standard Time)</p>
  </blockquote>
  
  <p>but it show me in console <code>"TypeError: date.split is not a function</code>" how to fix it?</p>
  
  <pre><code>   $scope.test = function(date) {
      console.log(date);
      $scope.d = (date.split(' ')[0]);
      $scope.m = (date.split(' ')[1]);
      $scope.y = (date.split(' ')[2]);
      $scope.dd = (date.split(' ')[3]);
  
  }
  </code></pre>