Skip to content
This repository has been archived by the owner on Apr 24, 2021. It is now read-only.

ES6 pattern for polymer elements does not work with data-binding system #10

Open
ebidel opened this issue Aug 13, 2015 · 1 comment
Open

Comments

@ebidel
Copy link

ebidel commented Aug 13, 2015

The pattern of creating properties in created does not work with polymer's data binding system.

For example, if you defined a <dom-module> and data-bound to tolerance, the console would throw an error in the console saying this is undefined.

<dom-module id="tuning-instructions">
  <template>
    <span>{{tolerance}}</span>
  </template>
</dom-module>

Instead, properties should be setup in properties:

get properties() {return {
  tolerance: {
    type: Number,
    value: 0.006
  }
};}

The setup currently works because you didn't use data binding features in the DOM.

Example: http://jsbin.com/mugewudime/edit?html,output

@kristianmandrup
Copy link

Could we please have a Starter Kit with an ES6 option included ;) Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants