I want to get current routes catid param and do a if query inside component without waiting for an async request response. No matter what I tried I couldn’t get the current route parameters, all I get is previous page parameters.
path: '/:appId/:catID/:fID/',
component: {
template: `{{#if items}}<div data-name="{{items.dname}}" class="page single single-1 no-navbar" id="{{items.b}}" title="{{items.title}}">
<div class="tabs-swipeable-wrap " id="{{items.gn}}"><a href="{{items.a0}}" class="{{items.a1}} close-button">
</a> <div class="tabs listw" id="{{items.catsid}}">
{{/if}}
{{#if items}}
<div id="tab-1" class="page-content no-padding-top tab tab-active" >
<div class="cblocks">
{{#if catID }} // I want to get current routes catid param and do a if query here.
<div class="content"><a id="play" class="aplay"><div class="acontent"><div class="circle-wave"><button id="abutton" class="acontrols"></button></div></div></a>
{{else}}
<a class="pb-s no-fastclick" data-base="{{items.id}}" data-no="1"><img src="{{items.c}}" class="cover" alt="{{items.s15}}/></a><div class="content">
{{/if}}`,
data: function () {
if (app.view.current.router.currentRoute.params.catID === "ringtones") // this does not compare the catid to the current routes catid.
{ return {
items: {
"dname":"ringtone","a0":"#","a1": " back ","s17": "link external ","s21":"red","s14":"color-red"
}}
} else
{ return { items:{
"dname":"single","a0":"#","a1": " back ","s17": "link external ","s21":"red","s14":"color-red"
}
}}
}
},