Problem is that if I change back to index
view with url: ""
from any other state, the page content changes but not the url.
$stateProvider
.state('index', {
url: "",
views: {
...
}
})
.state('route1', {
url: "/route1",
views: {
...
}
})
So imagine being on *.com/route1
and clicking on the navbar logo back to index
. The url still displays .com/route1
although I would expect the url to be .com
.
I wanted to create a plunker, but there was no need since one of the most popular templates there already has the same issue: Plunker.
To see the issue you must go to preview mode from the top right corner (blue button). And go to Route 1
and back to Home
. Look at the url.
I am quite sure that this has been asked somewhere but unfortunately I am not able to come up with the correct search term to find an answer.
Is this an issue with ui-router? Are there any known fixes to this problem?
Think I'm gonna solve this by making some "root" state urls absolute as described in this answer: Angular UI Router - Dynamic states get double slashes when navigated to with ui-sref.
Ui-router absolute states: Absolute Routes (^)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments