title: Getting an error while creating factory object
body: <p>I have a module and controller which are created like :</p>
  
  <pre><code>var API_ENGINE_URL = 'localhost/angular/';
  var mainApp = angular.module('mainApp', ['ngRoute', 'ngResource']);
  
  
  mainApp.controller('productController', ['$scope', 'ProductFactory', 'ProductListFactory','$routeParams', function ($scope, ProductFactory,routeParams, ProductListFactory) {
      var productList = new ProductListFactory();// THROWS ERROR HERE
      var promise = productList.$get({id: $routeParams.category_id}).$promise;
      promise.then(function (productList) {
          $scope.productList = productList;
      });
  }]);
  </code></pre>
  
  <p>and the Model is created like this, files are properly loaded</p>
  
  <pre><code> mainApp.factory('ProductListFactory', ['$resource',function ($resource) {
      return $resource(API_ENGINE_URL + 'category/:id/items', {}, {
          get: {method: 'GET', params: {category_id: '@category_id', id: '@id'},isArray:true,url:API_ENGINE_URL+'product?store_id=:storeId'},
          save: {method: 'GET', isArray: true}
  
      });
  }]);
  </code></pre>
  
  <p>I am getting an error in the controller like below. what could be the error. Stuck for a long time
  <a href="https://i.stack.imgur.com/pCeQi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pCeQi.png" alt="enter image description here"></a></p>