Skip to content

Instantly share code, notes, and snippets.

@hvgotcodes
Last active August 24, 2016 19:33
Show Gist options
  • Save hvgotcodes/f22720b573f2a90c4f113ec6aa679ad2 to your computer and use it in GitHub Desktop.
Save hvgotcodes/f22720b573f2a90c4f113ec6aa679ad2 to your computer and use it in GitHub Desktop.
chainer
import Ember from 'ember';
import Chainer from 'app/components/my-chainer'
export default Chainer.extend({
first(){
console.log('subclass first', this)
}
});
import Ember from 'ember';
export default Ember.Component.extend({
doChain(){},
actions: {
performChain(){
console.log('about to doChain')
debugger;
this.get('doChain')()
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
first(){
console.log('in first', this)
},
second(){},
chain(){
debugger;
console.log('starting chain')
this.first();
this.second();
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{chainer-subclass}}
<br>
<br>
{{#invokes-chainer doChain=chain}}
hi
{{/invokes-chainer}}
<button type="button" {{action "performChain"}}>Invokes chainer</button>
{{yield}}
<button type="button" {{action "chain"}}>Chain stuff</button>
{
"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