How to "refresh" the router from child component In Octane

In the new Octane version, How do we refer to the current router from the child component.

**Router**
export default class SomeRouter extends Route {    
    model() {
        return data;        
    }
    @action
    refreshRoute() {
        this.refresh();
    }
}

**SomerRouter.hbs** 
<ChildComponent  >

**ChildComponent**
export default class ChildComponent extends Component { 
    @action
    revert() {
       //How do I invoke the "refreshRoute" on the SomeRouter from here.
    }
}

You can pass your refreshRoute action down into the components.

<ChildComponent @refreshTheThing={{this.refreshRoute}} />

and then invoke this.args.refreshTheThing() inside your revert() method.

Also, it’s possible to inject the router service into a component and talk to it directly, if it has the methods you want.

1 Like

Thank you. I implemented the solution as you suggested, it worked.