MysqlSubscription with Router
Is it possible to use MysqlSubscription with Iron-Router or Flow-Router?
Yes, You can use MysqlSubscription with Iron Router instead of using it on the client file.
Router.route('page', {
...
subscriptions: function() {
return [
subsctriptionOne = new MysqlSubscription('name_one'),
subsctriptionTwo = new MysqlSubscription('name_two')
]
...
} );
I cant get this to work, I keep getting the error "Exception in callback of async function: Error: Subscription failed!". It works when I try the subscription without return and Meteor.subscribe.
My code:
Router.route('measurementDetail', { path: '/measurements/:_id/dashboard', waitOn:function(){ return [ Meteor.subscribe("measurementEdit", this.params._id), mysqlSub = new MysqlSubscription('measurementData', this.params._id) ] } });
Why doesn't this work?
HELP
This work:
waitOn: function() {
return [Subs1.reactive(), Subs2.reactive(), Subs3.reactive()];
},