显示对话框在'meteorJs'中不工作?

显示对话框在'meteorJs'中不工作?,meteor,Meteor,我需要帮助,因为我已经使用meteorJs开发了模式对话框。当点击添加客户端按钮打开对话框时,它不工作,但它不工作。请检查我哪里出错,下面是我的代码 template: <template name="shedule"> <button class="btn btn-success addClients">Add Client</button> </template> Js code: Session.setDefault('showcl

我需要帮助,因为我已经使用meteorJs开发了模式对话框。当点击添加客户端按钮打开对话框时,它不工作,但它不工作。请检查我哪里出错,下面是我的代码

template:
<template name="shedule">
    <button class="btn btn-success addClients">Add Client</button>
</template>

Js code:
Session.setDefault('showclientDialog', false);
template.shedule.events({
    'button #addClient':function(e,t){

         console.log("You pressed Add Client button");
         e.preventDefault();
         Session.set('showclientDialog' , true);
    }
});
template.shedule.showclientDialog = function(){
    return Session.get('showclientDialog');
}
模板:
添加客户端
Js代码:
setDefault('showclientDialog',false);
template.schedule.events({
“按钮#添加客户端”:函数(e,t){
log(“您按下了添加客户端按钮”);
e、 预防默认值();
set('showclientDialog',true);
}
});
template.shedule.showclientDialog=函数(){
return Session.get('showclientDialog');
}

我相信这对你来说应该是可行的:

模板:

添加了一个if块来检查会话变量


如上所述,我进行了修改,但它不起作用@Serkan Durusoy发生了什么?您的浏览器控制台上有任何错误吗?您的代码中可能还有其他部分会导致其他问题。单击事件不起作用,并且在运行app@Serkan durusoy时没有出现错误。您可以尝试将
template
更改为
template
谢谢您提供建议,但在事件js代码到位按钮中我正在编写单击它再次起作用谢谢@塞尔坎杜鲁索
<template name="shedule">
    <button class="btn btn-success addClients">Add Client</button>
    {{#if showclientDialog}}
        <div class="clientDialogue">Client Dialoge</div>
    {{/if}}
</template>
Session.setDefault('showclientDialog', false);
Template.shedule.events({
    'click .addClients':function(e,t){

         console.log("You pressed Add Client button");
         e.preventDefault();
         Session.set('showclientDialog' , true);
    }
});

Template.shedule.showclientDialog = function(){
    return Session.get('showclientDialog');
}