title: angular app TypeError: Cannot read property 'slice' of undefined
body: <p>I'm trying to learn angularjs. I use filter function to order some items like this:</p>
  
  <pre><code>angular.module('reverseDirective', [])
  .filter('reverse', function() {
      return function(items) {
          return items.slice().reverse();
      }
  });
  </code></pre>
  
  <p>When I put this to html file</p>
  
  <pre><code>&lt;div class="panel-body" ng-repeat="each in story.stories | reverse"&gt;
                      &lt;p&gt;{{ each.content }}&lt;/p&gt;
  </code></pre>
  
  <p>The console always show this error:</p>
  
  <pre><code>TypeError: Cannot read property 'slice' of undefined
      at http:localhost:3000/app/directives/reverse.js:6:15
      at fn (eval at &lt;anonymous&gt; (http:localhost:3000/js/angular.min.js:212:83), &lt;anonymous&gt;:4:203)
      at Object.&lt;anonymous&gt; (http:localhost:3000/js/angular.min.js:117:376)
      at n.$get.n.$digest (http:localhost:3000/js/angular.min.js:132:124)
      at n.$get.n.$apply (http:localhost:3000/js/angular.min.js:135:269)
      at l (http:localhost:3000/js/angular.min.js:87:152)
      at F (http:localhost:3000/js/angular.min.js:91:187)
      at XMLHttpRequest.K.onload (http:localhost:3000/js/angular.min.js:92:220)
  </code></pre>
  
  <p>I searched and tried, but still cant find a solution, so I'm waiting.</p>