Theres is a Meteor Windows Release bug?
When I try this, works:
//Main File
Persons = {}
Persons.person = {name : "Roger", age : 30}
//Another file
console.log(Persons.person);
But when I call in another JS, like the code bellow, with a "console.log("Persons")" dont works:
PersonsCollection = new Mongo.Collection("persons");
Meteor.subscribe("allPersons");
// THIS CODE
console.log(Persons);
if (Meteor.isServer) {
PersonsCollection.allow({
insert : function () {
if(Roles.userIsInRole(Meteor.userId(), ['admin'])){
return true;
} else{
return false;
}
},
update : function () {
if(Roles.userIsInRole(Meteor.userId(), ['admin'])){
return true;
} else{
return false;
}
},
remove : function () {
if(Roles.userIsInRole(Meteor.userId(), ['admin'])){
return true;
} else{
return false;
}
}
});
}
The structure:
models/personsCollection.js //Bug here
models/test1.js //I have created the global var here
models/test2.js //I called here