Ember: this.router.refresh() throws error in ember octane

466 Views Asked by At

This is the below code I am using while doing refresh the route

export default class MyController extend Controller {
    @service router;

    @action refresh() {
         this.router.refresh()
    }
}

While calling this.router.refresh() it throws like refresh function not present.

1

There are 1 best solutions below

0
jelhan On

The RouterService does not have a refresh method yet. An RFC to add one was merged in October 2020 but has not been implemented yet.

This hasn't changed with Ember Octane. The RouterService never had a refresh method yet. Maybe you meant the refresh method of Route? This one exists both in Octane as well as before.