Hacker News new | ask | show | jobs
by jonperl 4310 days ago
I have built and integrated some pretty complex components with blaze templates without needing a component api. I am curious what use case you ran into where the template api was not sufficient?

In your comment history I saw that you asked for reactive template variables. I know of two ways to accomplish that, 1) attach a ReactiveDict to a template instance in it's render function, 2) pass it in as a variable to the template inclusion {{>template myDict}}.

1 comments

Since Meteor automatically scopes by file, you can write your template helpers and event handlers in the same file, and place a reactive data structure at the top of the file that both can access.

You could use reactive-object (my package), as it provides a fairly drop-in reactive object that supports arrays as reactive properties, including all the Array.prototype methods.