Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/411.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何为Meteor中的anti:modals添加帮助函数_Javascript_Meteor - Fatal编程技术网

Javascript 如何为Meteor中的anti:modals添加帮助函数

Javascript 如何为Meteor中的anti:modals添加帮助函数,javascript,meteor,Javascript,Meteor,在Meteor中,我使用@Hubert OG提供的anti:modals包创建模态和叠加 Template.product.events({ 'click .__yellow': function(e, t) { AntiModals.overlay('modal', { modal: true, ove

在Meteor中,我使用@Hubert OG提供的anti:modals包创建模态和叠加

            Template.product.events({

                'click .__yellow': function(e, t) {
                    AntiModals.overlay('modal', {
                        modal: true,
                        overlayClass: 'yellow',
                    });
                },
            });
单击事件加载一个模板文件:“模态”。这一切都是开箱即用的。由于它呈现了一个模板,我希望/认为可以向模板添加帮助程序

像这样:

            Template.modal.helpers({
                products: function () {
                    return Products.find({});
                },
                image:function(){  
                    return productImages.findOne({'metadata.productId':this._id})
                }
            });
但这不起作用。它不运行任何错误,只是不渲染任何内容。但是,如果我将这些助手添加到任何其他模板中,它都会起作用


我希望有人能帮忙

刚刚快速查看了该软件包,但查看了该软件包的构建方式、它的构建版本以及在过去8个月内未进行维护,这表明该软件包有点过时

也许最好找到其他处理modals的软件包,或者简单地使用一个类似于foundation的javascript插件(我使用这个插件,它运行得非常稳定)


希望它能帮助你

谢谢丹尼斯。我在我的项目中与基金会合作。揭示无法开箱即用,所以我转向反:情态动词。你手动配置了显示吗?没问题,你可以用多种方式加载基础。我更喜欢在atmosphere上使用bower(meteor有一个包),因为最初的作者通常维护他们的bower版本,但不维护atmosphere版本。Bower基本上会自动地加载基础、最小的CSS和基础.j.js,但是你也可以把它们放在你的流星包中。ur缺少的部分可能在呈现布局模板后调用方法“$(document).foundation();”。。Templat.mainLayout.onRendered在我的案例中。酷。我来检查一下。谢谢