Skip to content

Instantly share code, notes, and snippets.

@drewclauson
Last active December 21, 2015 19:01
Show Gist options
  • Select an option

  • Save drewclauson/d2362cf84e53dcf565cb to your computer and use it in GitHub Desktop.

Select an option

Save drewclauson/d2362cf84e53dcf565cb to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Knock knock!',
userName: 'Emberman'
});
<h1>{{appName}}</h1>
<br>
<br>
{{my-component name=userName}}
<br>
<br>
import Ember from 'ember';
export default Ember.Component.extend({
nameBinding: 'computedName',
computedName: Ember.computed(
function(){
return "Not Emberman";
}
),
actions: {
getName: function() {
alert(this.get('name'));
}
}
});
<button {{action "getName"}}>Who is this?</button>
{
"version": "0.4.17",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.1.1",
"ember-template-compiler": "2.1.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment