1
これは私が、以下に示す3つのオプションをすべて試してみました 、同じように私flowrouterがどのように見えるかです:しかし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の名前で次のように