I want to animate transitions of repeated templates. It is non-obvious how to do it.
Is there a pattern others are using? Any hints?
What I am trying to do:
<template repeat="{{item in items}}">
<div>{{item.title}} {{item.count}}</div>
</template>
I want to slide in items being added, and fade out items getting removed.
Items list can be modified without me knowing what modification was (firebase-element).
1st attempt was to animate on dom mutation events.
I'd use events to detect insertion/removal, and animate when detected. Detection used mutations traversal, and is still buggy. This approach feels kludgy:
- there is code that knows when insertion/removal happens, I should not have to reverse engineer these
- lots of mutation events, feels inefficient
2nd attempt was going to be hacking TemplateBinding.
TemplateIterator.insertInstanceAt and extractInstanceAt have the data I need. Monkeypatching this will cause future headaches, so I decided to ask the group before diving in.
Thanks,
Aleks