0👍
So the way I usually handle these issues is by passing the cursors as data through Iron Router and check if the data is available. For example:
Router.route('/', {
waitOn: [
function() {
if (!Meteor.userId()) {
Router.go('/login');
}
return Meteor.subscribe('data');
}
],
action: function() {
this.render('template');
},
data: function() {
return {
data: Data.find({})
};
}
})
<template name="template">
{{#if data}}
...
{{/if}}
</template>
Let me know if this works.
Edit:
just noticed the tag for a different router
- [Vuejs]-How to map through lodash and return false in the prop value
- [Vuejs]-Vue2 : Handle change events on X number of dropdowns ?
Source:stackexchange.com