Javascript iron router:事件中命名的成品中的渲染模板
我是否可以使用iron router以特定的方式呈现事件中的模板 模板:Javascript iron router:事件中命名的成品中的渲染模板,javascript,meteor,iron-router,Javascript,Meteor,Iron Router,我是否可以使用iron router以特定的方式呈现事件中的模板 模板: <template name="groupDetails"> {{#with selectedGroup}} <h2>{{name}}</h2> {{> groupNav}} {{> yield 'groupOption'}} {{/with}} </template> 我想通过按下按钮在名为“gr
<template name="groupDetails">
{{#with selectedGroup}}
<h2>{{name}}</h2>
{{> groupNav}}
{{> yield 'groupOption'}}
{{/with}}
</template>
我想通过按下按钮在名为“groupOption”的成品中呈现一个名为“stats”的模板。在模板帮助程序和事件中,您可以使用对Iron.controller()的引用,该引用返回当前的RouteControl
var controller = Iron.controller();
// you now have access to all controller properties and methods
所以你的活动看起来像
Template.groupNav.events({
'click .groupStatisticsNavLink': function () {
var controller = Iron.controller();
controller.render('stats', { to: 'groupOption' });
}
});
Template.groupNav.events({
'click .groupStatisticsNavLink': function () {
var controller = Iron.controller();
controller.render('stats', { to: 'groupOption' });
}
});