Skip to content

Instantly share code, notes, and snippets.

@hergaiety
Last active June 1, 2016 16:15
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 hergaiety/9c933a0e8b3f94473e35ca6576d6c0ca to your computer and use it in GitHub Desktop.
Save hergaiety/9c933a0e8b3f94473e35ca6576d6c0ca to your computer and use it in GitHub Desktop.
Listening for All Sub Properties
import Ember from 'ember';
export default Ember.Controller.extend({
obj: Ember.Object.create({thing: 'Foo'}),
objThing: Ember.computed('obj.[]', function() {
return this.get('obj.thing');
}),
init: function() {
this._super();
Ember.run.later(() => {
console.log('ran');
this.set('obj.thing', 'Bar');
}, 100);
}
});
{
"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