I am using Angular UI Router and seem to be experiencing a strange problem. When I click on the link to which the ui-sref directive is attached, it successfully loads the new view, as I would expect, HOWEVER, it does not update the URL bar. I believe this happens because the parent URL is a dynamic StateParam /:room. How do I solve this problem?
Here is a snippet of my user interface
.state({
name: 'room',
url: "/:room",
views: {
"main": {
templateUrl: "views/pages/chat.html",
controller: "RoomCtrl"
},
"login@room": {
templateUrl: "views/partials/_login.html"
},
"navigation@room": {
templateUrl: "views/partials/_navigation.html",
controller: "NavigationCtrl"
}
},
resolve: {
userLocation: function(geolocationFactory) {
return geolocationFactory;
}
}
})
.state({
name: 'room.share',
url: "/share",
views: {
"share@room": {
templateUrl: "views/partials/_share.html",
controller: "ShareCtrl"
}
}
});
u-sref
<button id="share-button" ui-sref="room.share">Share</button>
source
share