$location is unusable in hybrid angular apps
In our hybrid project, the routing is done by https://angular.io/guide/router. Therefore, it is not done by some NG1 router. In this case, the $location service cannot be used anymore. The solution is to access the native location object via $window.location.