Hello there, I have a specific problem. I used MeteorKitchen, so some code could look worse than normal.
I installed collection2, because of yogiben:admin, and add a schema to my
"both/collections/invoices.js":
Schemas={};
Schemas.Invoicess = new SimpleSchema({
invoiceNumber:{
type:Number
},
date_issued:{
type:Date
},
date_due:{
type:Date
},
customerId:{
type:String
},
totalAmount:{
type:String
}
});
And when the code is done, I lose my collection on my page where I use that collection (collection is undefined).
The collection on page is named: “fakturka”.
Of course I did in:
“server/publish/invoices.js”:
Meteor.publish("fakturka", function(invoiceId) {
return Invoices.find({_id:invoiceId,ownerId:this.userId}, {});
});
“client/views/invoices/new/insert/insert.js”:
Meteor.subscribe("fakturka", this.params.invoiceId),
fakturka: Invoices.findOne({_id:this.params.invoiceId}, {}),
When I comment my Schema, the “fakturka” is ready to be seen (defined), but when I add the schema, the “fakturka” is undefined. It’s only one collection I have problem with, because others work properly.
Is it ok that I use subcontest on that page? Because “normal” site path is client/views/invoices/new/new.html, and I have a subpage in that ( ./insert/insert.html)