I have made a function that will deal with many templates on created and destroy.
Since writing each template helper(created/destroyed) will be repeatable I thought of making a templates array, and a function which calls Template.template-variable.created *and* Template.template-variable.destroyed
on a forEach
loop (of templates array).
At first when I ran it as Template.template-variable.created/destroyed = function() {};
I was running through an error saying template-varible not defined, as it was taking it as is.
Then I made a variable as var created = 'Template.' + template-variable + '.created';
And then used it as created = function() {};
instead of Template.template-variable.created = function() {};
And here is where I end, cause, Meteor no longer brings Template ref. error, but won't run the code inside the function, even tried console.log('created');
didn't work.
I need help.