Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 65d170c

Browse files
author
Scott J. Miles
committed
allow imperative construction of polymer-element element by factoring out bootstrap code (init) and only invoking it automatically if name attribute is not empty
1 parent 95ee58d commit 65d170c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/declaration/polymer-element.js

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727

2828
var prototype = extend(Object.create(HTMLElement.prototype), {
2929
createdCallback: function() {
30+
if (this.getAttribute('name')) {
31+
this.init();
32+
}
33+
},
34+
init: function() {
3035
// fetch the element name
3136
this.name = this.getAttribute('name');
3237
//console.log('createdCallback', this.name);

0 commit comments

Comments
 (0)