I'm working with 3 different files:
- [root]/client/js/welcome.js
- [root]/client/js/ups.js
- [root]/client/js/main.js (I also renamed it xxx.last.js)
Code:
//welcome.js
function Welcome(){
console.log("main");
}
Welcome.prototype.constructor = Welcome;
Welcome.prototype.displayPage = function(page){
var jQ_page = $("#" + page);
var title = jQ_page.attr("data-tile");
$("#main").css("display", "none");
jQ_page.css("display", "block");
document.title = title;
};
//ups.js
function Ups(){
this.query = {};
this.creteria = {sort: {JB_owner: 0}, limit: 500, skip: 0, fields: {ClusterId: 0}};
console.log("UPS");
}
Ups.prototype.constructor = Ups;
Meteor.startup(function() {
var mainObj = new Welcome();
var UpsObj = new Ups();
$(document).ready(function() {
...
...
...
});
});
Welcome and Ups are undefined and I don't understand why, all three files are being loaded and according meteor Docs that should works but it doesn't, any hint or help?
thanks!
Welcome.prototype.constructor = Welcome;I'm don't usually extend the prototypes but that line seems like you are assigning something to itself.