Skip to content

Instantly share code, notes, and snippets.

@ohcibi
Last active December 7, 2015 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ohcibi/3059bc31648fe4b0a9cb to your computer and use it in GitHub Desktop.
Save ohcibi/3059bc31648fe4b0a9cb to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
fooBar() {
this.set("foo", "bar");
}
},
appName:'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{foo-bar foo=bar fooBar="fooBar"}}
app: {{foo}}
<br>
<br>
import Ember from 'ember';
export default Ember.Component.extend({
/*setFoo: Ember.on("didInitAttrs", function() {
this.set("foo", "bar");
}),*/
setFoo2: Ember.on("didInitAttrs", function() {
this.sendAction("fooBar");
})
});
component: {{foo}}
{
"version": "0.4.16",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "canary",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.1.0/ember-data.js",
"ember-template-compiler": "canary"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment