Last active
August 6, 2017 00:25
-
-
Save mariechatfield/54905616e05f17021771fa043b9c387a to your computer and use it in GitHub Desktop.
Ember Events: click Component Attribute
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
export default Ember.Controller.extend({ | |
actions: { | |
handleClick(event) { | |
console.log('This action was fired by Ember, as a result of a DOM event.'); | |
console.log('This is the original DOM event that is associated with this action: ', event); | |
} | |
} | |
}; |
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
<!-- This is what is actually added to the DOM when the template is rendered. --> | |
<div id="ember328" class="click-attribute ember-view">[... component content ...]</div> | |
<!-- | |
This element does not have a native event listener attached. | |
You can verify this in your browser's JavaScript console: | |
> document.getElementsByClassName('click-attribute')[0].onclick | |
null | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment