title: Angular js resource call to get json data in array
body: <p>Created factory that will return json data and calling it from controller, but it is coming empty.
  don't know where I made mistake.
  no <strong>console</strong> error and in <strong>network</strong> json is also loading.</p>
  
  <pre><code>    'use strict';
  var app = angular.module('angularJson', ['ngResource']);
  
      app.factory('loadJsonService', ['$resource', function ($resource) {
          return {
              getData: function () {
                  return $resource('json/productDetails.json');
              }
          };
      }])
  
    app.controller('angularJsonCtrl',['$scope', 'loadJsonService',function($scope, loadJsonService){
  
      $scope.loadProducts = function(noOfData){
          $scope.productDetails = [];
          $scope.productDetails = loadJsonService.getData().query();
      }
  
    }]);
  </code></pre>