How is the view updated? Can you delay changes?

33 views
Skip to first unread message

Don Olmstead

unread,
Nov 10, 2015, 2:24:43 PM11/10/15
to Polymer
I was wondering how the view contained within the template gets updated. The scenario I'm wondering how to handle is updating the data bindings only after a condition is met.

<dom-module id="build-card">
 
<template>
   
<div>{{model.status}}</div>
 
</template>
</dom-module>

Lets say that I want to animate the color of the build-card when the status is changed, and also want to fade out the div containing the {{model.status}}. Is there any way I can stop the template update until the animation is complete? I know there's the neon-animate stuff but I wanted to get a sense if there's a way to just handle that within a polymer element without dragging in another component. Also wanted a better idea on when any template changes are triggered.

Thanks!

Justin Fagnani

unread,
Nov 11, 2015, 12:49:25 PM11/11/15
to Don Olmstead, Polymer
I haven't done much with animations, but one approach that comes to mind is to take control over all properties used by the template (and possibly all propagated to child elements). Use observers on the mutable public properties, and private properties in the templates, then start animations and queue up the changes to the private properties when the animations finish.

Maybe someone else on the team can offer more...

Cheers,
  Justin


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/e1ead6c3-0683-498e-9d3d-1d40a103c5c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages