2014-11-25 1 views
0

폴백 경로를 만드는 각도 경로가 있습니까? 이 같은
예를 들어 뭔가 : 당신이 '/ B'경로는 다음 해결되지 않으면이 경로 '/ A'로 폴백됩니다 볼 수있는 예에서경로 폴백을 해결하지 않았습니다.

$routeProvider 
    .when('/a', { 
     templateUrl: 'a.html', 
     controller: 'aCtrl' 
    }) 

    .when('/b', { 
     templateUrl: 'b.html', 
     controller: 'bCtrl', 
     resolve: {/* some resolving */}, 
     fallbackRoute: 'a' 
    }) 

    .when('/c', { 
     templateUrl: 'c.html', 
     controller: 'cCtrl' 
    }) 

    .when('/d', { 
     templateUrl: 'd.html', 
     controller: 'dCtrl', 
     resolve: {/* some resolving */}, 
     fallbackRoute: 'c' 
    }) 

.

이렇게하려면 어떤 패턴이 있습니까? otherwise은 a, c가 다른 경로이기 때문에 나에게 도움이되지 않습니다. 문서에 따르면

감사

답변

0

: If any of the promises are rejected the $routeChangeError event is fired.

그래서 당신은이 이벤트에 가입 (경로 정보와 속성을 사용하여) 다른 경로로 리디렉션 할 수 있습니다. 구현 예가 필요한 경우 작성하십시오.

+0

음, 좋은 해결책이 될 것입니다. 필요 없음 – vlio20

관련 문제