I try to access to JSON file data using Meteor JS. But I'm unable to access it. Can anybody suggest what I'm doing wrong?
Folder Structure :
myapp project/lib folder - myfile.json
myfile.json:
EJSONObj = {
"first": "John",
"last": "Doe",
"age": 39,
"sex": "M",
"salary": 70000,
"registered": true,
"favorites":
{
"color": "Blue",
"sport": "Soccer",
"food": "Spaghetti"
}
}
Meteor JS :
if (Meteor.isClient)
{
console.log("My JSON File data:"+EJSONObj.age);
}
Error is :
Uncaught ReferenceError: EJSONObj is not defined