How to redefine method in Ember Component?


(megas) #1

I need to modify method _dock in discourse/components/topic-progress.js.es6 file from my plugin.
What is the syntax of modifying this component? So far I came to this construction, but it doesn’t work:

import topicProgress from 'discourse/components/topic-progress';
Ember.Component.reopen({
  _dock: function() {
    console.log("=========")
    this._super();
    console.log("=========")
  }
});

(Robin Ward) #2

Where did you put that code?

You should be doing it in an initializer.