The answers to my previous questions on this topic have not been satisfactory.
It seems that most examples and tutorials for AngularJS online always define tiny JSON arrays directly inside the JavaScript code...
So, let's simplify things with a basic example:
(function(){
var app = angular.module('store', [ ]);
app.controller('StoreController', function(){
this.product = products;
});
var products = [
{name: "Linux Mint", origin: "Ireland"},
{name: "Ubuntu", origin: "Isle of Man"},
{name: "OpenSUSE", origin: "Germany"},
{name: "Fedora", origin: "USA"}
];
})();
I want to modify the "products" array to load a JSON file from the same folder; I am not allowed to use external tools or frameworks, and I cannot set up servers as suggested in some previous responses. Furthermore, I cannot change the existing code, only the part after the "=", possibly utilizing $scope and $http.
How would you approach this in a functional manner?