I am currently facing an issue where I use a code snippet to load strings from an external json-file. While everything works fine, running the function locally triggers a 'cross origin' problem. As a solution, I attempted to input the strings directly into my JS file, but unfortunately, it did not work.
Original JS
$scope.loadAutosuggest = function(query) {
return $http.get('data.json');
};
data.json
[
"In Progress: Yes",
"In Progress: No"
]
I have tried implementing this alternative approach (which also did not work)
$scope.loadAutosuggest = [
"In Progress: Yes",
"In Progress: No"
];
If you have any advice or tips for me on how to resolve this issue, I would greatly appreciate it. Thank you.