Skip to content

Instantly share code, notes, and snippets.

@Mariusio
Created February 3, 2016 18:15
Show Gist options
  • Save Mariusio/13241a681ce7a14edc58 to your computer and use it in GitHub Desktop.
Save Mariusio/13241a681ce7a14edc58 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Component.extend({
// Does not fire
dataObserver: Ember.on('didInsertElement', Ember.observer('visualization', function() {
console.log("visualization changed");
})),
// Does fire
dataObserver: Ember.on('didInsertElement', Ember.observer('visualization.fontSize', function() {
console.log("visualization changed");
})),
didInsertElement() {
console.log('didInsertElement visualization-component');
AmCharts.makeChart("visualization-" + this.get('visualization').get('id'),
JSON.parse(JSON.stringify(this.get('visualization')))
);
},
didUpdateAttrs(options) {
console.log('didUpdateAttrs visualization-component', options);
},
didInitAttrs(options) {
console.log('didInitAttrs visualization-component', options);
},
willUpdate(options) {
console.log('willUpdate visualization-component', options);
},
didReceiveAttrs(options) {
console.log('didReceiveAttrs visualization-component', options);
},
willRender() {
console.log('willRender visualization-component');
},
didRender() {
console.log('didRender visualization-component');
},
didUpdate(options) {
console.log('didUpdate visualization-component', options);
console.log('didUpdate called!');
console.log(this.get('visualization').get('fontSize'));
AmCharts.makeChart("visualization-" + this.get('visualization').get('id'),
JSON.parse(JSON.stringify(this.get('visualization')))
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment