I'm trying to get the params of the URL originally entered in the browser. But angular "redirects" me automatically to '/'
For example, I enter this URL : http://localhost:9080/#/test?param1=en¶m2=55
But I end up getting : http://localhost:9080/#/
var config = function (AppConfig, $urlRouterProvider) {
'ngInject';
$httpProvider.interceptors.push(function ($q, $location) {
return {
'request': function (config) {
var params = $location.search(); //here : $location is already returning the wrong URL : http://localhost:9080/#/
return config;
}
}
});
};
Here is my only route :
$stateProvider.state('test', {
url: '/',
views: {
'testView@' : {
templateUrl: '/app/test/test.html',
controller: 'test.controller',
controllerAs: 'testVM'
}
}
});
Why is that ? Is there a way to get the original URL ?
Use:
Or