I want to get data from a JSON file by using $http.get with AngularJS.
I use the "new way" to write AngularJS scripts (link).
Nothing happens, Firebug tells me nothing.
I think the problem is in my activate() function code, I don’t really understood the promises.
function activate() {
return $http.get('test.json').then(function(data) {
vm.result = data;
return vm.result;
});
}
Have you an idea about this ?
.jsonstatic files? In IIS this would need to be added to the known mime types section. Check that whatever web server you are using is configured<mimeMap fileExtension=".json" mimeType="application/json"/>$httpajax apis under the hood may not work properly in this case since I dought there is ever anyXMLHttpRequestinvolved.