Created
August 10, 2016 20:38
-
-
Save timurvafin/0743fa3a78bebb626fec37645582ecf5 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
class CustomComponent | |
constructor: (@$el) -> | |
@dataKey = "custom-key" | |
@defaults = {} | |
@options = @_options(@$el) | |
_bindEvents: -> | |
@$el.on "click", ... | |
_options: ($el) -> | |
$.extend @defaults, $el.data(@dataKey) | |
new CustomComponent(el) for el in $("[data-custom-key]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment