2014-06-20 66 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 
};