riot.route('/*', function(category) {
riot.mount('#main', 'category-page', category)
})
When URL change, I want to get parameter as "category" and use it in <category-page>
.
I tried console.log(this.opts.category)
in <category-page>
, but what I got is undefined.
riot.route('/*', function(category) {
riot.mount('#main', 'category-page', category)
console.log(category)
})
When I code like above, console.log(category)
works well. So I think do wrong with passing or getting parameter. I tried many case but I couldn't resolve it.
Please help me with this problem.