Skip to content

Instantly share code, notes, and snippets.

@JonForest
Created April 16, 2016 20:00
Show Gist options
  • Select an option

  • Save JonForest/ef4947d01b461677cd2cafdac829d587 to your computer and use it in GitHub Desktop.

Select an option

Save JonForest/ef4947d01b461677cd2cafdac829d587 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
const {get} = Ember
export default Ember.Component.extend({
clicked() {
console.log(this)
// this.clicked results in: this === Class
// get(this, 'clicked')() resuls in: this === undefined
// this.get('clicked')() results in: this === undefined
},
actions: {
onClick() { //captures a button click
console.log('this.clicked')
this.clicked()
console.log('get(this, "clicked")')
get(this, 'clicked')()
console.log('this.get("clicked")')
this.get('clicked')()
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment