ng-repeat for an array represented by a variable
<p>I'm trying to use ng-repeat to display an array. Depending on the value of a variable, the array ng-repeat loops through should change.</p>

<p>Here is what I have done so far (which doesn't work)</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;body ng-app="myApp" ng-controller="myCtrl"&gt;

&lt;h1 ng-repeat="x in selection"&gt;{{x}}&lt;/h1&gt;
</code></pre>

<p><strong>JS</strong></p>

<pre><code>var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
  $scope.records1 = [
    "Apple",
    "Orange",
    "Banana",
    "Mango",
  ];
  $scope.records2 = [
     "Lion",
     "Tiger",
     "Crocodile",
     "Olephant"
  ];
  $scope.selection = records1;

});
</code></pre>

<p>What am I doing wrong here and what is the correct way to accomplish this?</p>