When your page loads you should initialize values such as "current_page" based on URL parameters. You'll also need to update those URL parameters when the user is paging through data to keep the URL in sync with what's actually on screen. Then if the user hits "Refresh" the page will load back to the correct state.
This is how I'm handling it:
In my html template whenever the user needs to navigate for example to the next page, I'll call an action on my controller, similar to this:
<a ng-click="gotoPage(currentPage+1)">Next Page</a>
In my controller, I'll initialize page based on the URL using $location.search() to pull the current value. It's passed in as "page" in the url. My url looks like "
http://site.com/app/#/somelist?page=5" when user is on page 5 of results:
$scope.pager.currentPage = $location.search().page != null ? $location.search().page : 1; // default to page 1 if not specified
Then my gotoPage function looks like this:
$scope.gotoPage = function(pageNum) {
$scope.pager.currentPage = pageNum; // update content on screen
$location.search({page: $scope.pager.currentpage}); // update URL with new current page
}
This works, when user pages data the new page number gets saved in the URL. When page is first visited, with no page= in the URL parameters, it defaults to 1. If user pages around and refreshes, it captures the current "page" back from the URL parameter and uses that to populate the initial view.
If you have other values you can also add them to your $location.search(...) call, and read them back in when page is loaded as I did with currentPage above. My screen has several search fields and filters that are also tracked as the user navigates the results. This has worked well for me.
Nick