We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad3459d commit 329aa27Copy full SHA for 329aa27
Elroid.js
@@ -3,6 +3,7 @@ class Elroid {
3
constructor(options) {
4
this.el = options.el;
5
this.data = options.data;
6
+ this.template = document.querySelector(options.el).innerHTML;
7
8
this.compile();
9
this.bindEvents();
@@ -47,7 +48,8 @@ class Elroid {
47
48
update(data) {
49
Object.assign(this.data, data);
50
const compiledTemplate = this.compileTemplate(this.template);
- this.el.innerHTML = compiledTemplate;
51
+ const el = document.querySelector(this.el);
52
+ el.innerHTML = compiledTemplate;
53
54
}
55
0 commit comments