title: Meteor live templates and pure JS variables
body: <p>I have the following very simple Meteor app:</p>
  
  <p>in tags.html</p>
  
  <pre><code>&lt;body&gt;
    {{&gt; tags}}
  &lt;/body&gt;
  
  &lt;template name="tags"&gt;
    &lt;input type="button" id="submit" value="Change tag" /&gt;
    {{tags}}
  &lt;/template&gt;
  </code></pre>
  
  <p>...and in tags.js</p>
  
  <pre><code>var tags = 1;
  
  if (Meteor.isClient) {
      Template.tags.tags = function() {
          return tags;
      };
  
      Template.tags.events({
          'click #submit': function() {
              console.log("You pressed the button");
              tags += 1;
          }
      });
  }
  </code></pre>
  
  <p>When I start the app I get a button and the initial value of the var tags (1) right next to it, which is correct.
  Then when I click the button the value of tags increases (I can check in the console), but the template does not re-render.
  Is this normal behavior? I am not sure what should I expect - could not find anything in the documentation that would tell me when exactly does the live template gets re-rendered.</p>
  
  <p>If I change the var to use the Session object however:</p>
  
  <p>in tags.html</p>
  
  <pre><code>&lt;body&gt;
    {{&gt; tags}}
  &lt;/body&gt;
  
  &lt;template name="tags"&gt;
    &lt;input type="button" id="submit" value="Change tag" /&gt;
    {{tags}}
  &lt;/template&gt;
  </code></pre>
  
  <p>...and in tags.js</p>
  
  <pre><code>var tags = Session.set("tags", 1);
  
  if (Meteor.isClient) {
      Template.tags.tags = function() {
          return Session.get("tags");
      };
  
      Template.tags.events({
          'click #submit': function() {
              console.log("You pressed the button");
              Session.set("tags", Session.get("tags") + 1);
          }
      });
  }
  </code></pre>
  
  <p>... all works fine.</p>
  
  <p>Can anyone shed some more light?</p>