title: Angular ng-repeat to print array values in a HTML table
body: <p>I have an array in my app.js file, contents of which I would like to print sequentially in <code>&lt;td&gt;</code> rows in my HTML table.
  Below is my app.js file:</p>
  
  <pre class="lang-js prettyprint-override"><code>(function () {
   var app = angular.module('TravelI', []);
  
  var route = [{
      source : [
          "San Jose",
          "San Francisco",
      ],
  
      destination : [
          "Wellington",
          "Mumbai"
      ],
  
  
  }];
  app.controller('RouteController', function ($scope) {
      $scope.product = route;
  
      $scope.addRoute = function(s, d) {
  
      };
  
  });
  
  })();
  </code></pre>
  
  <p>HTML code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="DisplayTable" ng-repeat="x in product"&gt;
          &lt;table style="width: 80%" align="center"&gt;
              &lt;tr&gt;
                  &lt;th&gt;
                      From
                  &lt;/th&gt;
                  &lt;th&gt;
                      To
                  &lt;/th&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;{{x.source[$index]}}&lt;/td&gt;
                  &lt;td&gt;{{x.destination[$index]}}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Now I can only see the data correctly for the first element in the arrays. I want the display to be like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>From                         To:
  San Jose                     Wellington
  San Francisco                Mumbai
  </code></pre>
  
  <p>Any city that I append to the two arrays should be displayed sequentially in the table rows. </p>
  
  <p>Currently I can only see the first element in both the arrays:
  <a href="https://i.stack.imgur.com/W1qgj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W1qgj.png" alt="enter image description here"></a></p>