Skip to content

Commit

Permalink
fix observers
Browse files Browse the repository at this point in the history
  • Loading branch information
aomran committed Jun 6, 2015
1 parent f3fb1c9 commit 4edfd85
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions addon/components/ember-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export default Ember.Component.extend({
}

this.set('chart', chart);
this.addObserver('data.[]', this.updateChart);
this.addObserver('options', this.updateChart);
this.addObserver('data', this, this.updateChart);
this.addObserver('data.[]', this, this.updateChart);
this.addObserver('options', this, this.updateChart);
},

willDestroyElement: function(){
Expand All @@ -30,8 +31,9 @@ export default Ember.Component.extend({
}

this.get('chart').destroy();
this.removeObserver('data.[]', this.updateChart);
this.removeObserver('options', this.updateChart);
this.removeObserver('data', this, this.updateChart);
this.removeObserver('data.[]', this, this.updateChart);
this.removeObserver('options', this, this.updateChart);
},

updateChart: function(){
Expand Down

0 comments on commit 4edfd85

Please sign in to comment.