Skip to content

Instantly share code, notes, and snippets.

@HenryVonfire
Created March 21, 2016 15:30
Show Gist options
  • Save HenryVonfire/4e3837011958f4ed9850 to your computer and use it in GitHub Desktop.
Save HenryVonfire/4e3837011958f4ed9850 to your computer and use it in GitHub Desktop.
Slack example
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#comp-1 as |options|}}
{{comp-2 contentChanged=options.contentChanged}}
{{/comp-1}}
<br>
<br>
import Ember from 'ember';
export default Ember.Component.extend({
actions:{
contentChanged(){
this.set('result','yey!');
}
}
});
{{result}}
{{yield (hash contentChanged=(action 'contentChanged'))}}
import Ember from 'ember';
export default Ember.Component.extend({
actions:{
contentChanged(){
this.get('contentChanged')();
}
}
});
<button {{action 'contentChanged'}}>click me</button>
{
"version": "0.6.5",
"EmberENV": {
"FEATURES": {}
},
"options": {
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.0/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment