Skip to content

Instantly share code, notes, and snippets.

@nailkhasipov
Created April 25, 2018 15:59
Show Gist options
  • Save nailkhasipov/9e10f7ef70b755123f7d23ec8570fc82 to your computer and use it in GitHub Desktop.
Save nailkhasipov/9e10f7ef70b755123f7d23ec8570fc82 to your computer and use it in GitHub Desktop.
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