Skip to content

Instantly share code, notes, and snippets.

@srvance
Forked from alexspeller/components.my-component.js
Last active August 12, 2016 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srvance/c9ba29e3c2f98937d4d0c8e493261a78 to your computer and use it in GitHub Desktop.
Save srvance/c9ba29e3c2f98937d4d0c8e493261a78 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'button',
click() {
this.sendAction();
}
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
parentAction() {
alert('parent action');
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
{{#my-component as |parentAction|}}
{{#my-mid}}
{{#my-button action=parentAction}}
Click
{{/my-button}}
{{/my-mid}}
{{/my-component}}
{{yield (action 'parentAction')}}
{{yield (action 'parentAction')}}
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment