Hi, I'm trying to understand the lifecycle callbacks in the demo app 'pica'.
If I set a break point in components/polymer-elements.js createdCallback:
var prototype = extend(Object.create(HTMLElement.prototype), {
createdCallback: function() {
if (this.getAttribute('name')) {
this.init();
}
},
Then the call stack is:
d.createdCallback (polymer-element.js:22)
(anonymous function) (polymer-element.js:147)
(anonymous function) (polymer-element.js:147)
where 147 is:
document.registerElement('polymer-element', {prototype: prototype});
In the function createdCallback, 'this' is an HTMElement with local name 'polymer-element'.
I expected this callback when an instance of the custom element 'polymer-element' is created, not when the type is registered. I could not find anything in the spec to suggest that registration should have this effect.
What do you expect here?
jjb