Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Force refreshing on a route causes $location.path() to be wrong. #2762

Closed
@Siyfion

Description

@Siyfion

When I navigate to a route such as http://www.test.com/products/management and force a refresh, the $routeProvider fails to match it against any routes and pushes me back to http://www.test.com/products (not even a valid route!). I think that this is because $location.path() incorrectly reports the current path as /management.

Here's my route configuration for reference:

  angular.module('labelLogicLiveApp')
    .config(function ($locationProvider, $routeProvider) {

      // Use HTML5 strategy if available.
      $locationProvider.html5Mode(true).hashPrefix('!');

      $routeProvider
        .when('/', {
          templateUrl: '/views/home.html'
        })
        .when('/user/login', {
          templateUrl: '/views/user_login.html'
        })
        .when('/product/management', {
          templateUrl: '/views/product_management.html',
          resolve: { isAuth: 'authService' }
        })
        .when('/product/:productId', {
          templateUrl: '/views/product_details.html',
          resolve: { isAuth: 'authService' }
        })
        .otherwise({
          redirectTo: '/'
        });
    });

image

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