Skip to content

location is not updated when url is an empty string #3563

Closed
@lafeuil

Description

@lafeuil

When I configure a state with this params :

state = {
  name: 'main',
  url: '/{id}',
  params: {
    id: {
      squash: true,
      value: null
    }
  },
}

and I go to this state with $state.go('main'), the location address bar is not updated.
I take a look at code and I find that the new path is correctly generated by the urlMatcher and it returns an empty string. So, the new url in location address bar must be for example http://localhost.
But the location service doesn't update the location when url is an empty string. The condition stops updating :

if (newUrl) this.$location.url(newUrl);

if (newUrl) this.$location.url(newUrl);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions