Skip to content

Instantly share code, notes, and snippets.

@morhook
Created January 5, 2017 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morhook/0b63c8d939ee46ad115c397b58608595 to your computer and use it in GitHub Desktop.
Save morhook/0b63c8d939ee46ad115c397b58608595 to your computer and use it in GitHub Desktop.
test actions, once again
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
callmechild() {
console.log('called in child');
//this.sendAction('callmeup');
this.send('callmeup');
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
callmeup() {
console.log('on parent method directly');
},
actions: {
callmeup() {
console.log('on parent action directly?');
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{my-component target=this}}
{{outlet}}
<br>
<br>
{{yield}}
startmeup
<button onclick={{action "callmechild"}} >clickme</button>
{
"version": "0.10.7",
"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.10.0",
"ember-data": "2.10.0",
"ember-template-compiler": "2.10.0",
"ember-testing": "2.10.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment