I'm accessing the URL parameters of my Angular 4 app using RouterStateSnapshot
and it works just fine:
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
// state.root.queryParams will hold my URL parameters
}
the problem is that as soon as I edit my RouterModule
configuration and set useHash: true
the code above stops workings for some reasons because state.root.queryParams
will always be null.
Why is it that? How to solve the problem?