Last active
December 21, 2015 04:28
-
-
Save geraudmathe/6249329 to your computer and use it in GitHub Desktop.
how to bind the same function to differents events
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
App.MyView = Ember.View.extend({ | |
tagName: "td", | |
my_function: function(){ | |
alert("Do stuff here") | |
//in this context, you should be able to get content directly by the key , like this.get('myKey') | |
// and the controller is available via this.get('controller') | |
}, | |
click: function(){ | |
my_function() | |
}, | |
touchstart: function(){ | |
my_function() | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment