Data binding equality in Polymer 1.0

70 views
Skip to first unread message

Steven Bennetts

unread,
Jun 23, 2015, 7:38:22 PM6/23/15
to polym...@googlegroups.com
In Polymer .5, it was pretty convenient to write:

<div hidden$="{{someSelector != 'foo'}}">

Is there a general way to do this in Polymer 1.0 other than include something like:

<div hidden$="[[equals_(someSelector, 'foo']]">
equals_: function(a, b) { return a == b; }

in every Polymer element that needs this?

Arthur Evans

unread,
Jun 24, 2015, 10:30:43 AM6/24/15
to Steven Bennetts, polymer-dev
I think this has been mentioned before, but if you want to reuse a set of computing functions in multiple elements, you can put them in a behavior.

Here's a demo:



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/CADko7PFun%2BEoBpvNtDDPdyKdWfi5s210aOFqbgCci-qa_VnyVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages