title: angularjs TypeError: undefined is not a function factory
body: <p>I'm in the middle of playing around with angularjs. I'm trying to simply pull data from a json file. When I run my code the file shows up in the network, but the data doesn't show up on the page and I get the following error in my console:</p>
  
  <blockquote>
    <p>TypeError: undefined is not a function at Ob
    (lib/angular-1-2/angular.min.js:14:6)</p>
  </blockquote>
  
  <p>The code I'm using is as follows:</p>
  
  <pre><code>var Services = angular.module('Services', ['ngResource']);
  Services.factory('reportFactory', function($http){
      console.log(REPORT_LIST_URL);
      return{
          getReports: function(callback){
              $http.get(REPORT_LIST_URL).success(callback);
          }
      }
  });
  
  function ReportsCtrl($scope, $http, reportFactory) {
      $scope.reportsList = [];
      console.log($scope.reportsList);
      console.log("Get report list from json file");
      console.log("before the factory");
      reportFactory.getReports(function(data){
         $scope.reportsList = data;
      });
  }
  </code></pre>
  
  <p>example of the json file</p>
  
  <pre><code>{
    "Reports": {
      "Productivity": [
        {
          "name": "Productivity Summary",
          "value": "Productivity"
        },
        {
          "name": "Time Summary",
          "value": "TimeSummary"
        }
      ]
    }
  }
  </code></pre>
  
  <p>Any help or advice is greatly appreciated. </p>
  
  <p>Thanks</p>