enumerated list (enum) with Polymer

180 views
Skip to first unread message

frank....@gmail.com

unread,
Jul 15, 2013, 11:08:47 AM7/15/13
to polym...@googlegroups.com
Hi guys,

Could anyone tell me how to register an enum with Polymer? So it's only possible to select / have 1 out of X values/attributes?

For example to toggle the visibility of 2 templates. Only 1 of the 2 is allowed to be rendered?

I couldn't find anything about this on the Polymer website and on the discussion board.

Thanks in advance.

Greetings,
Frank

Eric Bidelman

unread,
Jul 15, 2013, 1:05:44 PM7/15/13
to frank....@gmail.com, polymer-dev
Hi Frank,

Most people use objects to replicate enums in JS. There's no special way to do
them in Polymer. 

One way to do what you want is you use conditional templates. The example isn't
perfect, as people can still override your values...but it works :)



--
 
---
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.
Visit this group at http://groups.google.com/group/polymer-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/87f8ee19-4c2d-4c88-a9d6-ec63338d6cc5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Frank Volmer

unread,
Jul 16, 2013, 3:41:09 AM7/16/13
to Eric Bidelman, polymer-dev
Hi Eric,

Thanks for the fast reply. I will look into it.

--
---
Engweg 5-III
3972 JB Driebergen
06 38 722 777
frank....@gmail.com
Reply all
Reply to author
Forward
0 new messages