Skip to content

Instantly share code, notes, and snippets.

@blahutka
Created May 12, 2017 06:54
Show Gist options
  • Save blahutka/cb6d7452ef2cf6d5aa2a9a211ad3956d to your computer and use it in GitHub Desktop.
Save blahutka/cb6d7452ef2cf6d5aa2a9a211ad3956d to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
click(attr, ev) {
console.log('wrapperd');
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
pressCount: 0,
actions: {
buttonClick(attr, ev){
this.incrementProperty('pressCount');
console.log(attr);
},
anDoubleClick() {
alert('double')
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
{{pressCount}}
<br>
{{my-button-wrapper click=(action 'buttonClick' '1') }}
<br>
<br>
<div {{action "anDoubleClick" on="doubleClick"}}>
click me
</div>
{{my-button onclick=(action 'click' '1') onhover=(action click) }}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment