title: Pass attribute value into ng-repeat in angularjs
body: <p>I set up a directive called ogPostList in the following way:</p>
  
  <pre><code>angular.module('myApp')
     .directive('ogPostList', function() {
     return {
        restrict: 'E',
        scope: {
          page: '@'
        },
        templateUrl: '../scripts/directives/postList.html'
      };
   });
  </code></pre>
  
  <p>TemplateUrl:</p>
  
  <pre><code>&lt;input type="text" ng-model="searchText" placeholder="Search" class="postListSearch" /&gt;
  &lt;table id="post_list_table" ng-controller="PostListController"&gt;        
      &lt;tbody&gt;
          &lt;tr ng-repeat="postItem in {{page}} | orderBy:'toString()' | orderBy:'date':true | filter:searchText"&gt;
            &lt;td&gt;&lt;img title="{{'Post source ' + postItem.source}}" src="{{'images/' + postItem.source + '.svg'}}" height="20"/&gt;&lt;/td&gt;
            &lt;td&gt;{{postItem.post}}&lt;/td&gt;
            &lt;td width="70"&gt;{{postItem.date}}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The controller is set up as follows:</p>
  
  <pre><code>angular.module('myApp')
      .controller('PostListController', function($scope, $http) {
  
          var postsList = [];
          var postsListSummary = [];
          var postsListMain = [];
  
          $http.get('dummy_content.json')
            .then(function(res){
            postsList = res.data;
  
            for (var iSummary = 0; iSummary &lt; 10;iSummary++) {
                postsListSummary[iSummary] = postsList[iSummary];
             }
  
            for (var iMain = 0; iMain &lt; postsList.length;iMain++) {
               postsListMain[iMain] = postsList[iMain];
            }
  
         });
  
         $scope.postsSummary = postsListSummary;
         $scope.postsMain = postsListMain;
  
       });
  </code></pre>
  
  <p>What I want to be able to do is when I declare a og-post-list element is to pass a value through my page attribute. </p>
  
  <pre><code>&lt;og-post-list page="postsSummary"&gt;&lt;/og-post-list&gt;
  </code></pre>
  
  <p>This value {{page}} should then go to the ng-repeat section in my templateURL and then pull the appropriate array as shown in my controller in order to populate my table</p>
  
  <pre><code>&lt;tr ng-repeat="postItem in {{page}} | orderBy:'toString()' | orderBy:'date':true | filter:searchText"&gt;
  </code></pre>
  
  <p>However I see this is not allowed? Why is this and what would be a better way to tell my directive to display one of two arrays. The only difference between the 2 arrays is that 1 array one only contains 10 items and array 2 contains all elements pulled from my json file</p>