Last active
June 18, 2016 19:57
-
-
Save kawasako/a4214a0919ca680e4252ba6194e53f4e to your computer and use it in GitHub Desktop.
This file contains 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
import $ from 'jquery'; | |
class HogeWidget { | |
constructor(el) { | |
this.$el = $(el); | |
} | |
bind() { | |
this.$el.on('click', () => { ... }); | |
} | |
init() { | |
this.bind(); | |
} | |
} | |
// initializer | |
$('[data-widget="hoge"]').each(function(el) { | |
let w = new HogeWidget(el); | |
w.init(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment