Created
April 25, 2018 15:59
-
-
Save nailkhasipov/9e10f7ef70b755123f7d23ec8570fc82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App { | |
constructor(root) { | |
this.interface = new Interface(root); | |
} | |
} | |
class Interface { | |
constructor(root) { | |
root.innerHTML = '<button id="testButton">click me!</button>'; | |
this.root = root; | |
this.testButton = this.root.querySelector('#testButton'); | |
this.testButton.onclick = this.testButtonClick; | |
} | |
testButtonClick(e) { | |
console.log('clicked!', e); | |
} | |
} | |
new App(document.querySelector('#app')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment