Implement basic JSON file loading functionality.

This commit is contained in:
Kevin Dungs
2014-08-02 10:26:28 +02:00
parent ad9781989b
commit 1ef115e167
3 changed files with 36 additions and 6 deletions
+17 -6
View File
@@ -1,14 +1,25 @@
'use strict';
(function () {
var loadJsonFile = function(filename) {
var res;
$.ajax({
async: false,
url : filename,
success : function(data) {
res = data;
}
});
return res;
}
var discoveries = loadJsonFile('json/discoveries.json');
var workers = loadJsonFile('json/workers.json');
console.log(discoveries);
console.log(workers);
var app = angular.module('particleClicker', []);
})();
var discoveries = [
{
name: 'W-Boson',
description: 'Some nice description.'
}
];
+11
View File
@@ -0,0 +1,11 @@
[
{
"name": "W-Boson",
"description": "The W-Boson is the carrier boson of the weak force.",
"research": {
"reputation": 1,
"cost": 100
},
"histogram": {}
}
]
+8
View File
@@ -0,0 +1,8 @@
[
{
"name": "PhD Student",
"description": "Basically a slave just with fewer rights.",
"loan": 100,
"rate": 1
}
]