2016-04-22 68 views
0

我有我已經使用了我的app.I一個主佈局已經生成的使用鐵-CLI包我的應用程序和我的主人佈局稱爲master_layout.html使用第二主佈局

TI現在有一個問題。我所有的應用程序菜單都在主佈局中,我需要創建一個不需要菜單的登錄頁面。這可以解決,如果我有第二個主佈局,我可以從我原來的主佈局剝離菜單,並使用我的登錄頁面的佈局。

我的路線是這樣的

Router.route('/Limit/ay', { 
    name: 'ay', 
    controller: 'LimitController', 
    action: 'ay', 
    where: 'client' 
}); 

和我的控制器代碼看起來像這樣

ay: function() { 
     this.render('Ay'); 
    //this.render('Added', {}); 
    } 

有沒有一種方法,我可以再註冊一個總體佈局,並使用它自己的登錄頁面?

如果我註冊另一佈局

Router.configure({ 
    layoutTemplate: 'MasterLayout', 
    loadingTemplate: 'Loading', 
    notFoundTemplate: 'NotFound' 
}); 

Router.configure({ 
    layoutTemplate: 'GoodLayout' 
}) 

一個佈局正在使用,而另一個被忽略,所以我只能一次使用一個主佈局。

我該如何解決這個問題?

回答

0

只是覆蓋佈局新航線:

Router.route('/Limit/ay', { 
    name: 'ay', 
    layoutTemplate: 'GoodLayout', 
    controller: 'LimitController', 
    action: 'ay', 
    where: 'client' 
}); 

路線的版本將優先於全球佈局設置。