Iron Router Multiple Data Context with Meteor
Router.route('/things', {
name: 'things',
waitOn: function () {
return [this.subscribe('thing'),this.subscribe('thinga')];
},
data: function () {
return {
thing: Thing.find(),
thinga: Thinga.findOne({type: "abc"})
};
},
onAfterAction: function () {
Meta.setTitle('Things');
}
});
console.log('Template.instance().data.thinga.propertyname', Template.instance().data.thinga.propertyname);