What is the recommended way to define statics with polymer for polymer-element class?
(https://github.com/banguero/winjs-polymer-samples/blob/master/elements/winjs-pivot-item.html). Looking for something different than (http://www.polymer-project.org/docs/polymer/polymer.html#static) where if the definition is <polymer-element name="winjs-pivot-item" constructor="PivotItem" attributes="header">, I would like to set PivotItem.isDeclarativeControlContainer to a function after PivotItem is defined.
@sjmiles, @sorvell, @ebidel, @robdodson might have a good answer.
The concept of record is that we add a feature to look for a statics object on the prototype and mix it into the constructor. Something like this:
Polymer({
statics: {
staticFunction: function() {}
}
});
We haven't done this yet, because it bumps into the issue of globals. In other words, you cannot access the constructor (and therefore your statics) without having a reference somewhere. The constructor attribute creates such a reference, but it's in the global context.
Additional musings: it's possible to conceive of polymer-elements as modularized out-of-the-box: you access the module via document.createElement. This idea has not achieved great traction, IMO mostly because of ... perceptual blockage (i.e. people can't wrap their heads around it).