Skip to content

Preventing Resolve On URL Change Without State Reload #2796

@calebeno

Description

@calebeno

I've been working on a project and am having an issue with the resolve block. This is my use case: When transitioning to a state, a resolve block is completed. Once in the new state, a component determines whether or not the url needs to be changed. The goal is to remain in exactly the same state, but to modify the url. However, when I make the url modification using something like this:

$state.go($state.$current.self.name, {newparams}, {location: 'replace', reload: false, notify: false});

The entire state remains the same and the url is updated, which is the desired behavior. However, the resolve block is then called again, adding unnecessary server requests. Is it not possible to prevent the resolve block from running? I feel like using reload: false should prevent this.

Note: I commented something similar on issue #2146. Since it was closed and this is slightly different I have reposted as a different issue here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions