Iron Router data fires 3 times
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this route set up with a loding template on Router.Config Router.onBeforeAction('loading'); this.route('clients', { path: '/clients', template: 'clientsAll', waitOn: function () { return Meteor.subscribe('clientsAll'); }, data: function () { if (this.ready()) { console.log("Data"); return Clients.find().fetch(); } } }); Everything works fine it displays the loading template before rendering the template, but on the log it shows data being fired twice. 回答1: This is a normal behavior, data like most route methods is run inside a