title: Access JSON file in Angular.js
body: <p>I want to access json file in angular.js by using the following code but I am unable to access the code because of the below mentioned shown error.
  Help would be appreciated.!!</p>
  
  <p>module :</p>
  
  <pre><code>angular.module("demoApp", ['demoApp.factory','demoApp.controllers']);
  </code></pre>
  
  <p>Factory:</p>
  
  <pre><code>angular.module('demoApp.factory', []).
  factory('getJsonDataFactory',function($http){
      return{
      getData : function() {
          return $http.get('mapData.json');
      }
   }
  });
  </code></pre>
  
  <p>controller :</p>
  
  <pre><code>angular.module('demoApp.controllers', []).
    controller('GetJsonController', function($scope,$http,getJsonDataFactory) {
                $scope.markers = [];  
                getJsonDataFactory.getData().success(function(data){
                  $scope.photos=data;
              });
          });
  </code></pre>
  
  <p>Error :
  In firefox:</p>
  
  <pre><code> "Access to restricted URI denied" code: "1012"
  
  
  return logFn.apply(console, args)
  </code></pre>
  
  <p>In Chrome :`</p>
  
  <pre><code>Origin null is not allowed by Access-Control-Allow-Origin.
  </code></pre>