Skip to content

Instantly share code, notes, and snippets.

@john-kurkowski
Last active April 24, 2016 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john-kurkowski/ff93f095ae8d24335fe9a049a720135a to your computer and use it in GitHub Desktop.
Save john-kurkowski/ff93f095ae8d24335fe9a049a720135a to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
foo: '',
init() {
this._super(...arguments);
console.info(this.constructor, 'init', this.getProperties('foo', 'attrs.foo.value'));
},
didReceiveAttrs() {
this._super(...arguments);
console.info(this.constructor, 'didReceiveAttrs', this.getProperties('foo', 'attrs.foo.value'));
},
});
import Ember from 'ember';
export default Ember.Controller.extend({
myFoo: 'bar',
actions: {
mutateAttr() {
this.set('myFoo', 'baz');
}
}
});
{{my-component foo=myFoo}}
<button {{action 'mutateAttr'}}>Mutate attr</button>
{
"version": "0.7.2",
"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.4.4",
"ember-template-compiler": "2.4.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment