i’m getting a error when i trying to access to a local JSON file. This is my function to bring the data from the json.

        $scope.getJSON = function () { (self.servicioObj = jsonFactory.GetJson('data.json')).then( function (dataResponse) {$scope.datosJson = [];
$scope.datosJson = dataResponse.data; self.servicioObj.detenerTiempo(); }, function (error) { self.servicioObj.detenerTiempo(); }); }  And this is my Factory code.  function jsonFactory($http, $q) { var self = this; self.urlBase = 'http://192.168.0.17:8383/NewFrontEnd/app/pages/'; self.jsonFactory = {}; self.tiempoEspera = 120000; self.jsonFactory.GetJson = function (metodo) { var tiempo =$q.defer();
var url = self.urlBase + metodo;
var peticion = \$http({
method: 'get',
url: url,
cache: false,
timeout: tiempo.promise
});
return self.jsonFactory;
}


When i call the getJSON function i get this error message.

XMLHttpRequest cannot load http://192.168.0.17:8383/NewFrontEnd/app/pages/data.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8383' is therefore not allowed access.


I dont know why i’m getting this error if i put in the urlBase localhost instead of 192.168.0.17 i can access to the JSON file without any problem

Source: AngularJS