我的代码中有一个resolve
,它在本地运行得很好,所有测试也都通过了。但是,似乎缩小的代码会在这里引起一些问题。
当我暂存代码然后在本地运行时,它会导致与缩小代码相同的问题。解决方案块不再起作用了。
有没有办法将缩小的代码与实际代码进行比较以找出差异?
.state('index', {
url: '/',
resolve: {
trans: ['resolveService', function(resolveService) {
resolveService.languageResolve('main', {});
}]
},
controller: 'IndexCtrl'
})
.state('main', {
url: '/{language:[a-z]{2}}',
templateUrl: 'app/main/main.html',
controller: 'MainCtrl',
controllerAs: 'mainCtrl',
resolve: {
trans: ['resolveService', '$stateParams', function(resolveService, $stateParams) {
return resolveService.translateResolve($stateParams);
}],
redirect: ['resolveService', function(resolveService) {
return resolveService.resolveRedirect();
}]
}
})
.state('main.results', {
url: '/results/{route:nonURIEncoded}',
templateUrl: 'app/results/results.wrapper.html',
controller: 'ResultsCtrl',
resolve: {
urlParsed: ['urlParser','$stateParams','$state',function(urlParser,$stateParams,$state){
return urlParser.parse($stateParams.route).then(function(){ return true },function(err){
$state.go('main',{
language: $stateParams.language
});
});
}]
},
controllerAs: 'rc'
})