Skip to content

Instantly share code, notes, and snippets.

@derrickshowers
Created March 19, 2016 22:53
Show Gist options
  • Save derrickshowers/5f6366282b6c6c019e8a to your computer and use it in GitHub Desktop.
Save derrickshowers/5f6366282b6c6c019e8a to your computer and use it in GitHub Desktop.
Yielding Values
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#foo-component fName="Derrick" lName="Showers" as |computedName|}}
Hello {{computedName}}
{{/foo-component}}
<br>
<br>
import Ember from 'ember';
export default Ember.Component.extend({
fullName: Ember.computed('attrs.fName.value', 'attrs.lName.value', {
get() {
return `${this.get('attrs.fName')} ${this.get('attrs.lName')}`;
}
})
});
{
"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