Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular跳转到新页面后返回到上一页,返回到上一页跳转前的状态 #1

Open
jkhhuse opened this issue Dec 8, 2016 · 0 comments

Comments

@jkhhuse
Copy link
Owner

jkhhuse commented Dec 8, 2016

问题:angularJs列表中点击某条记录,跳转到新页面。当返回到列表后,仍然可以回到跳转前的页码处。
要做到上述效果,要把分页中的currentPage填写到url中,然后在新页面的url中也添加这个page信息。

$routeParams.page 获得url中的page
$route.updateParams({page:$scope.page}) 修改url中的page信息
$routeProvider.when('/demo/:page',{
    ...
})  路由写法
@jkhhuse jkhhuse added wontfix and removed wontfix labels Dec 8, 2016
@jkhhuse jkhhuse assigned jkhhuse and unassigned jkhhuse Dec 8, 2016
@jkhhuse jkhhuse changed the title ngRoute angular跳转到新页面后返回到上一页,返回到上一页跳转前的状态 Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant