hey @kartik,
In order to route to any custom URL or displaying message when user attend to certain unspecified route path,there are generally two ways to define in $stateProvider which is used to configure the UI-router.
The code is as follow:
var app= angular.module([$stateProvider , function($stateProvider){
$stateProvider
.state('root', {
url: '/',
template: '<strong> You are at root....</strong>
}
.state('noroute', {
url: '*path',
template: '<strong> No Root Available...</strong>
}
}]);
In order to redirect to existing route when no route found, the above code can be discard and include the $urlRouterProvider as follow:
var app= angular.module([$stateProvider , $urlRouterProvider, function($stateProvider, $urlRouterProvider){
$stateProvider
.state('root', {
url: '/',
template: '<strong> You are at root....</strong>
}
urlRouterProvider.otherwise('/');
}]);