Reputation: 8101
Currently, I've got a component something like this:
<polymer-element name="my-widget" constructor="MyWidget">
<script>
Polymer('my-widget', {});
MyWidget.someGlobalConfigValue = 1234;
</script>
</polymer-element>
Are there other approaches to this that I should consider?
(aside: It'd be neat if Polymer()
returned the constructor, so I don't have to force a name)
Upvotes: 7
Views: 2171
Reputation: 24109
One pattern is to use a component for configuration: http://www.polymer-project.org/docs/polymer/polymer.html#global
Upvotes: 7