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.

export default class SomeRouter extends Route {    
    model() {
        return data;        
    refreshRoute() {

<ChildComponent  >

export default class ChildComponent extends Component { 
    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.