In AngularJs, $routeProvider is used for configuring routes.
Requires the ngRoute module to be installed.
when(path, route);
Adds a new route definition to the $route service.
$routeProvider.when(‘/index’, { templateUrl: ‘/view/project.html’, controller: ‘projectController’ });
You can use,
otherwise(params)
Sets route definition that will be used on route change when no other route definition is matched.
.otherwise({ redirectTo: ‘/Home’ });
To redirect to home page when no other route is provided.
ProsperaSoft offers AngularJs development solutions. You can email at info@prosperasoft.com to get in touch with ProsperaSoft AngularJs experts and consultants.