0
Есть ли способ получить доступ к экземпляру Template из глобального помощника и наоборот?Access Template.TemplateName.helpers от Template.helpers и наоборот
/lib/route.js (с Iron Router):
Router.route('/', {name: 'home.view', controller: 'homeController'});
homeController = RouteController.extend({
template: 'home',
waitOn: function() {
Meteor.subscribe("Person", Meteor.userId());
},
data: function() {
// return some data;
}
});
homeController.helpers({
templateInstanceHelper: function() {
// Access a "global" helper here
}
});
/client/helpers.js:
Template.helpers("globalHelper", function() {
// Access the template instance helper here
});
Благодарю. Но мне нужен доступ к данным подписки экземпляра «Персона». Мне нужно, например, подсчет коллекции «Личность», в некоторых случаях мне нужна фактическая запись, и мне нужно присвоить запись «Личность» # контексту внутри самого шаблона. – Aaron