simplify TemplateHandler
This commit is contained in:
parent
b7f347ff4f
commit
4f1ed14f07
@ -20,15 +20,9 @@
|
|||||||
class TemplateHandler {
|
class TemplateHandler {
|
||||||
constructor(html) {
|
constructor(html) {
|
||||||
this._templates = new Map();
|
this._templates = new Map();
|
||||||
this._html = html;
|
|
||||||
this._doc = null;
|
|
||||||
|
|
||||||
this._initialize();
|
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||||
}
|
for (const template of doc.querySelectorAll('template')) {
|
||||||
|
|
||||||
_initialize() {
|
|
||||||
this._doc = new DOMParser().parseFromString(this._html, 'text/html');
|
|
||||||
for (const template of this._doc.querySelectorAll('template')) {
|
|
||||||
this._setTemplate(template);
|
this._setTemplate(template);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user