I've been struggling with an issue related to query string parameters for quite some time. When I navigate to /
, everything works perfectly fine. However, if I try something like /?anything
, it simply doesn't work. These are the configurations in my two separate files:
var access = accessConfig.accessLevels;
$stateProvider.state('store', {
abstract: true,
templateUrl: 'store/main.html',
data: {
access: access.user
}
});
$stateProvider.state('store.home', {
url: '/?cart',
views: {
'': {
templateUrl: 'store/home/home.html',
controller: 'store.home as vm'
}
},
data: {
title: 'Home'
}
});
Whenever I visit /
, everything works as expected without any problems. However, if I attempt to go to /?cart
or /?anything
, I end up on a blank page. Even though I have a stateChangeStart
event that is triggered when navigating to /
, it is not being invoked when I navigate to /?anything
.
Just to mention, I am utilizing html5mode(true)
. Any insights on what might be the issue here?
Interestingly, the functionality works when using ui-sref
, but not when directly copying/pasting URLs into the address bar.