I would not look at it as a 404 page.
In your SPA application (single-page application), you can make several API calls that update widgets on the control panel themselves, of which 9 out of 10 are successful (200) and one does not (404), in which case you do not want to redirect users .
Like David Barker said you have otherwise , which is a shared page.
app.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/login', { templateUrl: 'login.template.html', controller: 'LoginController' }). when('/', { templateUrl: 'dashboard.template.html', controller: 'DashboardController' }). otherwise({ redirectTo: '/' }); }]);
So, if the user enters the wrong route, go to the control panel, the only problem is the feedback:
1: you need a messaging service for feedback that the actual API 404 has an error response and that can be controlled using an interceptor, directive, and model.
2: you can send an error message using the start method and the same directive and model that look for $ routeChangeError, then adds an error message
I hope this helps.
Darren lilley
source share