I want to use json file content ( my json file is inside forms folder and i want to) inside my code
and for getting this data i use this script
var jsonFile=[];
inject(['$http', 'Uri', function($http, Uri) {
camForm.on('form-loaded', function() {
$http.get(Uri.appUri("engine://engine/:engine/task/" + "Task_0wobaoz" + "/form")).success(function(result){
var filePath = result.contextPath+'/forms/data.json';
$.getJSON(filePath, function(json) {
var jsonData=JSON.parse(json);
for(var i=0;i<Object.Keys(jsonData).length;i++){
jsonFile.push(jsonData[i]);
}
});
});
});
}]);
but this gives me exception like this:
Communication Error :
The application received an unexpected 400 response from the server. Try to refresh the page or login and out of the application.
what should i change to make this code work? will i need to implement this invokation ‘service’ somewhere else?