My Problem
While using Meteor JS I ran into something that I wasn't quite sure how to fix because everything seems to be loading in the corrector order. It still isn't acting in the correct way it is saying that the functions are not defined.
I have viewed other questions, most of which refer to the meteor methods section. I'm a little confused as to why I would need to wrap that in a Method object in order for all of them to be used.
My question is how would I get multiple functions and "faux" classes to be used as shared javascript files without using the meteor methods call and putting them in as sub objects.
Sample Class I'm trying use as shared js.
function CustomerProjects(){
// declare variables
this.name = null;
this.scope = null;
this.time = null;
this.completed = false; // set every project to default false
this.description = null;
// Get the time array
this.billableHours = function(){
if(this.completed){
var totalTime = 0; // int
var time = this.time;
// calculate time
for(var i = 0; i < time.length; i++){
totalTime = totalTime + time[i];
}
return totalTime;
} else {
return "Not Completed";
}
};
}
My File Structure