テンプレートを介してデータを渡したいのですが、未定義になっています顧客テンプレート内に2つの変数があり、ユーザーがクリックすると、これら2つの変数を次のテンプレートcustomerchathstoryに渡したいです
Template.customer.events({
async 'click .list-chat'(event,template) {
const Rid = event.currentTarget.id;
const Rtoken = event.currentTarget.token;
}
})
ここでは、customer.html でこのような var を渡しています。
{{>cutomerChatHistory clickRid= Rid clickRtoken = Rtoken }}
今、customerChatHistory.js 内でこれらの 2 つの変数を取得しているとき、未定義になっています
Template.customerChatHistory.onCreated(function() {
const currentData = Template.currentData();
console.log(currentData.clickRid , currentData.clickRtoken) //giving undefined here
})