title: query() with Angular $resources, "Undefined is not a function"
body: <p>So I am experimenting with Angular. I created the following module.</p>
  
  <pre><code>var archiveModule = angular.module('archiveModule', ['ngResource']);
  
  archiveModule.factory('Archive', ['$resource',
      function($resource) {
          return $resource('/data/archive/:doc.json', {}, {
              query: { method:'GET', params:{ doc: undefined }, isArray:true }
          });
      }]);
  
  archiveModule.controller('ArchiveControl', ['$scope', '$http', 'Archive',
      function ($scope, Archive) {
          $scope.items = Archive.query();
          $scope.orderProp = 'name';
      }]);
  </code></pre>
  
  <p>My template everything happens within:</p>
  
  <pre><code>&lt;div class="container" ng-app="archiveModule"&gt;
      &lt;div ng-controller="ArchiveControl"&gt;
  </code></pre>
  
  <p>I include the angular scripts at the bottom of my page:</p>
  
  <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.js"&gt;&lt;/script&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular-resource.js"&gt;&lt;/script&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular-route.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And Chrome reports <code>TypeError: undefined is not a function</code>, and it goes back to the line <code>$scope.items = Archive.query();</code>.</p>
  
  <p>According to <a href="http://docs.angularjs.org/api/ngResource" rel="nofollow">http://docs.angularjs.org/api/ngResource</a>.$resource, query is part of $resource and I modeled my resource off <a href="http://docs.angularjs.org/tutorial/step_11" rel="nofollow">http://docs.angularjs.org/tutorial/step_11</a> I'm not sure what's going wrong here.</p>