2014-06-20 67 views
2

它完美的作品时,我做它像这样为什么铁路路由器不能渲染轮播?

<body> 
{{> carousel}} 
</body> 
<Template name="carousel"> 
....here the code of carousel... 
</Template> 

但是当我使用铁路由器呈现模板;它不渲染旋转木马

<body> 
{{rendreRouter}} 
</body> 
<Template name="carousel"> 
    ....here the code of carousel... 
</Template> 

Router.map(function() { 
    this.route('carousel',{ 
    path: '/' 
    }); 
}); 
+2

你的榜样使用** {{rendreRouter}} **,我相信** {{renderRouter}} **应使用 –

+0

但是当我使用它;没有旋转木马的图像呈现,我不知道为什么或如何修复它,因为我是流星的新手 – abdou

+0

创建基本的流星应用程序,它再现了这个问题,并将其推送到一些github存储库,发送给我的链接,我会看看 –

回答

0

在template.rendered钩子中初始化您的传送带,例如我的模板名为main_slider。

Template.main_slider.rendered = function() { 
    // init carousel here 
};