我使用angular-ui-router 1.0.3
,我想实现这个网址http://localhost:8888/details/2020?pending=true
但是当我键入网址在浏览器和命中enter
加载网页时,自动更改URL这个http://localhost:8888/app/details/%7BParam:orderid%20%7BParamType:path%7D%20squash:%20'false'%20optional:%20false%7D?pending=%7BParam:pending%20%5Bobject%20Object%5D%20squash:%20%27false%27%20optional:%20true%7D
AngularJS UI.router重定向到URL可怕
这是我的app.config()代码
$stateProvider.state('details',{
url:'/details/:orderid?pending',
name:'details',
templateUrl:'/views/details.html',
resolve:{
load:function($q, $rootScope){
var dfrd = $q.defer();
require(['/js/details.js'],function(){
dfrd.resolve();
$rootScope.$apply();
})
return dfrd.promise;
}
}
})
如果我使用$state.go({details:2020,pending:true})
从其他视图完美的作品。
角度-UI-router.min.js:sourcemap:13过渡抑制($ ID时,我打的URL
而且我得到这个错误在控制台上输入出现的问题: 0 类型:2,消息:过渡已被其他 过渡取代,详细信息:过渡#1(''{} - > 'details'{“orderid”:“{Param:orderid {ParamType:path} squash:'false' 可选:false}“}))
您的网址以订单ID停止。不包括问号和挂起。 –
删除问号并挂起配置文件中的URL。 –
与'url:'/ details /:orderid''结果相同。当realod'http:// localhost:8888/details/2020'变成 'http:// localhost:8888/details /%7BParam:orderid%20%7BParamType:path%7D%20squash:%20'false'%20optional :%20false%7D' – Mariano