在AngularJS中重定向之前获取在浏览器中输入的URL?
我正在尝试获取最初在浏览器中输入的URL的参数。但是angular会自动将我“重定向”到在AngularJS中重定向之前获取在浏览器中输入的URL?,angularjs,angular-ui-router,angular-http-interceptors,Angularjs,Angular Ui Router,Angular Http Interceptors,我正在尝试获取最初在浏览器中输入的URL的参数。但是angular会自动将我“重定向”到“/” 例如,我输入以下URL:http://localhost:9080/#/test?param1=en¶m2=55 但我最终得到:http://localhost:9080/#/ 这是我唯一的路线: $stateProvider.state('test', { url: '/', views: { 'testView@' : {
“/”
例如,我输入以下URL:http://localhost:9080/#/test?param1=en¶m2=55
但我最终得到:http://localhost:9080/#/
这是我唯一的路线:
$stateProvider.state('test', {
url: '/',
views: {
'testView@' : {
templateUrl: '/app/test/test.html',
controller: 'test.controller',
controllerAs: 'testVM'
}
}
});
为什么呢?有没有办法获取原始URL?使用:
document.URL;
或
显示您的路线定义
document.URL;
window.location.href