Skip to content

Calling $state.go from parent state controller to current state causes URL to not be updated. #1583

Closed
@tom5760

Description

@tom5760

First, the Plunker.

I'm running into a small problem where calling $state.go() from a parent state controller, which may sometimes go to the current state, not updating the URL.

The usage is for a multi-step wizard process, where I have each step as a separate state/view/controller, with a parent state/view/controller with some minimal logic. One thing it tries to do is redirect to the first step if somehow someone initially goes to the URL of an intermediate step:

    .controller('WizardBaseCtrl', function ($state) {
        // Always go to the first step of the wizard, regardless of where you are coming from.
        $state.go('wizard.start');

In the case where the app is already transitioning from somewhere to wizard.start, the URL is not updated from where it was originally.

In the Plunkr, if from any of the states, you click the link for Bar One, the location will not be updated.

Any thoughts? Thanks!

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions