<!DOCTYPE html>
<html>
<head>
<script src="polymer.min.js"></script>
<polymer-element name="my-lifecycle" attributes="foo">
<script>
Polymer('my-lifecycle', {
created: function() {
console.log('created', this.foo);
},
ready: function() {
console.log('ready', this.foo);
},
});
</script>
</polymer-element>
</head>
<body>
<my-lifecycle foo="bar"></my-lifecycle>
</body>
</html>
This document
produces a console log of:
which surprised me, and doesn't seem to be implied by http://www.polymer-project.org/polymer.html#configuring-an-element-via-attributes or http://www.polymer-project.org/polymer.html#lifecyclemethods. This could just be a documentation issue, but
createdseems like the place to "configure" an element, so it seems like the attributes should be propagated in at this point rather than waiting untilready.