I have this piece of code inside a template event function (it is a pagination button), and when it is triggered, the url flicks like the url is changing, but it immediately comes back to the current URL and the template remains the same. No errors are thrown in the console.
'click [data-action=next]': function(e, t) {
Router.go('city.cards.page', {city: 'new-york', page: 3})
}
The funny thing is, when I execute the exact same code from the console instead of pressing the button, it works perfectly.
Here’s the route I’m using
Router.route('/cities/:city/cards/:page', {
subscriptions: function() {
this.subscribe('reports', {page: this.params.page}).wait();
},
name: 'city.cards.page',
template: 'City',
action: function() {
Session.set('selectedSection', 'cards')
if (this.ready()) {
this.render()
} else {
}
}
});
Any ideas? Thanks!