$ stateParams gets null after page refresh

When passing $ stateParams via $ state.go, it becomes correct when I click the link directly, but get null after refreshing the page or open through another window.

I have the following function:

$scope.urlvalues = function(url,page) { var result = {url:url, page:page}; $state.go("detailpage", result); } 

And my condition looks like this:

 .state('detailpage', { url: "/page/overview", templateUrl: "/page_details.html", controller: "PageDetailsController", params: { url: null, page: null }, }) 

Thanks in advance.

+5
source share
1 answer

Can you try:

 .state('detailpage', { url: "/page/overview/:url/:page", templateUrl: "/page_details.html", controller: "PageDetailsController", }) 

Then, when you go to the page, the url will be set and will be there when you refresh.

+5
source

All Articles