Angular routing otherwise

78 Views Asked by At

I'am writing an homepage using javascript, an express server and angular. Currently I have following routing:

function config($routeProvider) {
  $routeProvider
  .when('/', {
    templateUrl: '/login/login.view.html',
    controller: 'loginCtrl',
    controllerAs: 'vm'
  })
  .when('/home', {
    templateUrl: '/home/home.view.html',
    controller: 'homeCtrl',
    controllerAs: 'vm'
  })
  .otherwise({redirectTo: '/'});
}

Instead of the redirection in .otherwise to login page I would like that the user gets an page like:

Not found

The requested URL <requestedURL> was not found on this server.

How can I get the requested url in the controller of redirected page? Or what is the common way to implement this?

Kind regards, Wolfgang

0

There are 0 best solutions below