Skip to content

Instantly share code, notes, and snippets.

@geraudmathe
Last active December 21, 2015 04:28
Show Gist options
  • Save geraudmathe/6249329 to your computer and use it in GitHub Desktop.
Save geraudmathe/6249329 to your computer and use it in GitHub Desktop.
how to bind the same function to differents events
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