Template.myRoute.onCreated(function () {
console.log(this.data);
// Currently shows: {value: myData}
// Expected: myData (the actual document from MyCollection)
});
Expected behavior:this.data should directly contain the document returned by MyCollection.findOne().
Actual behavior:this.data contains {value: myData} where myData is wrapped inside a value property.
Has anyone encountered this issue? What could be causing this extra object wrapper, and how can I get the direct data without the value wrapper?
There is no need to use async calls on the client side. Typically, your iron router usage is on the client side, so keep using as you would normally do.
Might you consider doing a short talk on Iron Router on MeteorJS 3.x for Impact 2025? It may be useful to people who still need to upgrade their 1.x-based apps …