Skip to content

Instantly share code, notes, and snippets.

@seanjohnson08
Created September 14, 2016 18:45
Show Gist options
  • Select an option

  • Save seanjohnson08/f917bcd0a5a915052b2305e1a50119db to your computer and use it in GitHub Desktop.

Select an option

Save seanjohnson08/f917bcd0a5a915052b2305e1a50119db to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
name: Ember.computed.alias('model.name')
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
model: {
name: 'Evan',
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{my-component
model=model
name="Sean"}}
{{!-- thanks to the .alias in the component above, the model has been modified --}}
{{model.name}} wishes he were as cool.
<br>
<br>
{
"version": "0.10.5",
"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.8.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.8.0",
"ember-testing": "2.8.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment