Skip to content

Refreshing the browser doesn't refresh the ui-router's state when doing nested states. #105

Closed
@CMCDragonkai

Description

@CMCDragonkai

In a situation like:

                .state(
                    'blog',
                    {
                        abstract: true, //this state is abstract, it provides an abstract base for children (only abstract states can have a default child state)
                        url: '/blog',
                        templateUrl: 'blog.html',
                        controller: 'BlogCtrl'
                    }
                )
                .state(
                    'blog.posts',
                    {
                        url: '', //empty url demonstrates that it is the default childstate of the ui-view
                        templateUrl: 'blog_posts.html',
                        controller: 'BlogPostsCtrl'
                    }
                )
                .state(
                    'blog.post',
                    {
                        url: '/:blogPostId',
                        views: {
                            '': {
                                templateUrl: 'blog_post.html',
                                controller: 'BlogPostCtrl'
                            },
                            'comments': {
                                templateUrl: 'blog_post_comments.html',
                                controller: 'BlogPostCommentsCtrl'
                            }
                        }
                    }
                );

When you go into e.com/blog/123 and go back to e.com/blog by refreshing the browser or a location refresh, it doesn't change the state back to blog.posts. It does do it when I use the back button or hit on a link that changes the url, but a direct location refresh doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions