Files @ e06c2c105035
Branch filter:

Location: light9/light9/web/coffee_element.coffee

Drew Perttula
workaround for coffee issue with static getters. polymer wasn't seeing my attributes at all
Ignore-this: 192b2826e728db8b7ca6cfb67609241e
# Polymer seems to need static getters for 'observers' and
# 'listeners', not just static attributes, though I don't know how it
# can even tell the difference.
#
# This workaround is to use names like '@getter_properties' in the
# class then register with this function that fixes them.
# 
# Also see http://coffeescript.org/#unsupported-get-set
window.coffeeElementSetup = (cls) ->
  for attr in ['properties', 'observers', 'listeners']
    val = cls['getter_' + attr]
    if val?
      do (val) ->
        Object.defineProperty(cls, attr, {get: ( -> val)})  
  customElements.define(cls.is, cls)