On Jan 15, 2015, at 08:58, ServerMeta <alberto...@gmail.com> wrote:Template.hello.events({'click button': function () {// increment the counter when button is clickedSession.set("counter", Session.get("counter") + 1);var nameVal = template.find('#bot');console.log(nameVal);}});}The console gives me the error "Uncaught ReferenceError: template is not defined".What am I doing wrong? I’ve already tried reinstalling meteor.
Looks to me as if you might have this running in shared space.. Template is only defined on the client so wrapping in a Meteor.isServer or moving the code to a server directory should fix this error.
--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meteor-talk/183499AD-607A-4AFC-8211-460121619384%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/meteor-talk/CAB6spNyHg-KiYL4BLfP%2Bw87fVSVWNqafe94X-rR69O8yv259dA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meteor-talk/CAB6spNyHg-KiYL4BLfP%2Bw87fVSVWNqafe94X-rR69O8yv259dA%40mail.gmail.com.