Skip to content

Commit

Permalink
Merge pull request #106 from ahmadsoe/overriding-methods
Browse files Browse the repository at this point in the history
Prefer overriding didInsertElement and willDestroyElement
  • Loading branch information
ahmadsoe authored Dec 19, 2016
2 parents 1d59e20 + 2be1525 commit db0b2ec
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions addon/components/high-charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const {
computed,
get,
set,
on,
run,
$
} = Ember;
Expand Down Expand Up @@ -124,14 +123,18 @@ export default Component.extend({
}
},

_renderChart: on('didInsertElement', function() {
didInsertElement() {
this._super(...arguments);

this.drawAfterRender();
setDefaultHighChartOptions(getOwner(this));
}),
},

willDestroyElement() {
this._super(...arguments);

_destroyChart: on('willDestroyElement', function() {
if (get(this, 'chart')) {
get(this, 'chart').destroy();
}
})
}
});

0 comments on commit db0b2ec

Please sign in to comment.