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
Not sure what version of Angular JS the accepted answer was written on, but 'redirectTo' property takes in a function. So, why not do something simpler like this:
$routeProvider.otherwise({
redirectTo: function() {
window.location = "/404.html";
}
});
Obviously, you have to create your own 404.html. Or wherever your 404 page is.