Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Last active June 26, 2017 18:05
Show Gist options
  • Save kumkanillam/cb851b021b35dbb519e2dc567c2e394f to your computer and use it in GitHub Desktop.
Save kumkanillam/cb851b021b35dbb519e2dc567c2e394f to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Component.extend({
click(){
console.log(' click from my-child');
},
actions:{
test1(){
console.log('action click from my-child');
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
click(){
console.log(' click event from my-parent');
},
actions:{
test(){
// console.log('event ',event);
//event.stopPropagation();
console.log('action click from my-parent');
},
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
<div onclick={{action 'test1'}} style="width:50px;height:50px;background-color:green">
Child
</div>
{{yield}}
<div onclick={{action 'test'}} style="width:100px;height:100px;background-color:blue">
parent
{{my-child }}
</div>
{{yield}}
{
"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