在我的代码中,逻辑执行如下所示。
$state.go('root.detail', {cat_id : $scope.cat_id}, {location: 'replace'});
。通过这些,位置记录具有连续的详细页面。
我知道我们无法处理历史。
我认为使用$window.histroy.back();
更合适,而不是使用
$state.go('root.detail', {cat_id : $scope.cat_id}, {location: 'replace'});
删除历史记录。
有人有想法解决这个问题吗?
我添加了我的Paint文件,以便于理解我想要的内容。 :)
答案 0 :(得分:0)
这就是我的解决方法
$scope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams){
if(fromState.name == 'root.detail' && toState.name == "root.login"){
$location.path('/detailPagePath').replace();
};
});
将此代码放在详细信息页面控制器中,并将$ location添加为依赖项。...