#Situation
I’m trying to find a reliable and flexible solution for doing animations & transitions in meteor.
The timmyg:wow package seemd to be a great solution at first.
It’s dead easy to use and gives you all the power of animate.css.
#Problem
Unfortunately I couldn’t get this to work with a Collection and an {{#each}}-helper.
On insert the animation is repeated for all documents.
- The one being inserted into the collection (nice, love it)
- The ones already present in the collection (not what I need)
Is there a way around that?
#Example
Template:
<body>
<div class="container">
{{#each products}}
{{> product}}
{{/each}}
</div>
<button class="add">Add product</button>
</body>
<template name="product">
<div class="wow fadeInLeft">
My Product
</div>
</template>
Helpers & Events:
Products = new Mongo.Collection('products');
if (Meteor.isClient) {
Template.body.events({
'click .add': function() {
Products.insert({
date: new Date()
});
}
});
Template.body.helpers({
'products': function(){
return Products.find();
}
});
Template.product.onRendered(function () {
return new WOW().init();
});
}
Any help is much appreciated.