我的Iron Router配置中有以下设置:
Router.map(function () {
this.route('test', {
path: '/test',
template: 'test'
});
this.route('test_post_pay', {
path: '/test/:optionalParm?',
template: 'test',
data: {
message: 'thank you for donation'
}
});
});正如你所看到的,它们都指向相同的模板,但其中一个提供了一个消息变量,当页面加载时,有没有办法在我的Meteor代码中检查这个变量?如果Iron Router提供了一条消息,我想弹出一个模式
发布于 2014-03-28 00:44:36
您可以在handlebars模板中使用条件语句。
在这种情况下,它将是
{{#if message}}
<div class="modal">{{message}}</div>
{{/if}}https://stackoverflow.com/questions/22693826
复制相似问题