IContext > IInput

This commit is contained in:
barsdeveloper
2022-04-14 23:04:44 +02:00
parent d6aa7b22d2
commit 796deac851
9 changed files with 43 additions and 29 deletions

View File

@@ -9,6 +9,9 @@
*/
export default class ITemplate {
/** @type {Object[]} */
inputObjects = []
/**
* @param {T} entity
*/
@@ -22,11 +25,17 @@ export default class ITemplate {
setup(element) {
// TODO replace with the safer element.setHTML(...) when it will be availableBreack
element.innerHTML = this.render(element)
this.inputObjects = this.createInputObjects()
}
/**
* @param {T} element
*/
cleanup(element) {
this.inputObjects.forEach(v => v.unlistenDOMElement())
}
createInputObjects() {
return []
}
}