Created
April 16, 2016 20:00
-
-
Save JonForest/ef4947d01b461677cd2cafdac829d587 to your computer and use it in GitHub Desktop.
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
| 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