Skip to content

Instantly share code, notes, and snippets.

@etuchscherer
Last active June 9, 2016 16:19
Show Gist options
  • Save etuchscherer/5358d57f03fda59741b2f0a74e2ddc32 to your computer and use it in GitHub Desktop.
Save etuchscherer/5358d57f03fda59741b2f0a74e2ddc32 to your computer and use it in GitHub Desktop.
didUpdateAttrs hook
import Ember from 'ember';
export default Ember.Component.extend({
didUpdateAttrs(options) {
console.log('I updated a value', options);
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
counter: Ember.Object.create({
value: 1
}),
actions: {
click() { this.get('counter').incrementProperty('value')
}
}
});
{{my-component value=counter.value}}
<br>
<button {{action 'click' on='click'}}>click me</button>
{
"version": "0.8.1",
"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.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment