Jan,
Yikes, this is crazy. I am also having a hard time wrapping my head around the proper way to handle a template that expects to get completely redrawn but in fact now only has a single thing changed in Blaze.
--
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.
For more options, visit https://groups.google.com/d/optout.
<template name="fooBar"> <div id="fooBar" class="panel"> <h2>{{ getTitle}}</h2> <p>{{ getText}}</p> <div id="carousel"></div> <div> <div class="hidden">{{ updated }}</div> </template>
On each field that you want to trigger a rerender, opt into the update function by setting the 'updated' session variable with the current date. Then return the 'updated' session variable to the hidden field in the template.
Session.setDefault("updated", null); Template.fooBar.getTitle = function(){ Session.set("updated", new Date()); return this.title; }; Template.fooBar.getText = function(){ Session.set("updated", new Date()); return this.text; }; Template.fooBar.updated = function(){ // add stuff you want to happen on each rerender here console.log('Page title was ' + this.title + 'when updated at ' + Session.get("updated")); // for instance, $('#carousel').owlCarousel(); // this is where the rerendering magic happens return Session.get('updated'); }; // generalize the pattern with the following UI.registerHelper('updated', function(){ return Session.get('updated'); });