# How to redefine method in Ember Component?

**URL:** https://meta.discourse.org/t/how-to-redefine-method-in-ember-component/49988
**Category:** Development
**Created:** [September 11, 2016, 7:21pm UTC](https://meta.discourse.org/t/how-to-redefine-method-in-ember-component/49988 "2016-09-11T19:21:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sevenmaxis](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@sevenmaxis](https://meta.discourse.org/u/sevenmaxis)
#### Post date: [September 11, 2016, 7:21pm UTC](https://meta.discourse.org/t/how-to-redefine-method-in-ember-component/49988/1 "2016-09-11T19:21:18Z")

</div>

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("=========")
  }
});

```

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [September 12, 2016, 3:19pm UTC](https://meta.discourse.org/t/how-to-redefine-method-in-ember-component/49988/2 "2016-09-12T15:19:47Z")

</div>

Where did you put that code?

You should be doing it in an initializer.
