Using $routeProvider to redirect to routes outside of Angular

后端 未结 5 695
难免孤独
难免孤独 2020-12-05 04:34

I\'ve written part of a web application in Angular. To ensure that all routes are covered, I wanted to add a redirectTo property to the $routeProvider

5条回答
  •  渐次进展
    2020-12-05 04:41

    The above solution with /404 does not work for me. This however seems to work

    .otherwise({
        controller : function(){
            window.location.replace('/');
        }, 
        template : "
    " });

    PS. I am using Angular 1.2.10

提交回复
热议问题