2017-02-09 8 views
1

내 flowrouter의 모습을 어떻게 이것은, I 시도 아래와 같이 세 가지 옵션 :하지만 사전에 말에 문서를받지 못하고,Flowrouter 구독

import {CompanySettings} from '../imports/api/companysettingsMaster.js'; 
// And imported the api also.. 
FlowRouter.route('/', { 
    name: 'home', 
    subscriptions: function() { 
    // 1. 
    return this.register('companySettings', Meteor.subscribe('companySettings')); 
    // 2. 
    this.register('CompanySettings', Meteor.subscribe('companySettings')); 
    // 3. 
    return Meteor.subscribe('companySettings'); 
    }, 
    action: function() { 

    var themeSettings = CompanySettings.findOne({ 
     "companyId": 101 
    }); 
    if (themeSettings) { 
     console.log(themeSettings); 
     var scaleProcess = themeSettings.generalSettings.scaleProcess; 

     if (scaleProcess == 'retail') 
     BlazeLayout.render("retailMainLayout", { 
      content: "homepages" 
     }); 
     else { 
     BlazeLayout.render("WSEmainLayout", { 
      content: "homepages" 
     }); 
     } 
    } else { 
     console.log('no themeSettings'); 
    } 

    } 
}); 

를 구독 그러나 할 수없는 .. 어떤 제안은 .. 감사합니다

FlowRouter.route('/', { 
    waitOn: function() { 
     return Meteor.subscribe('companySettings'); 
    },  
}); 
다음

companySettings의 이름을 다음과 같이

답변

2

나는입니다 flowrouter에서 구독에 대한 대답을 얻었다 몽고의 컬렉션