当我输入一个网址时,在“ \”之后是另一个“ \”。例如:http://localhost:8080/#!//test。它将产生错误$ location:badpath。如果用户这样做,如何将其重定向到默认路由?
app.config(function ($routeProvider, $httpProvider) {
$routeProvider
.when('/test', {
templateUrl: 'project/view/test.html',
controller: 'TestController'
})
.otherwise(
{
redirectTo: '/dashboard'
}
);