title: how to get all values in for loop angular js
body: <p>when I alert this I only get the last value of id. ican't findout where I'm going wrong</p>
  
  <pre><code>  $scope.addToList = function (products,qty) {
      if ($scope.order.length &gt; 0) {
          for (var i = 0; i &lt; $scope.order.length; i++) {
              $scope.Thx=$scope.order[i].id;
              }}};
  
     alert($scope.Thx);
  </code></pre>