I have web application with structure like:
root -> [page1, page2, etc]
The problem is what i need router functionality only on page2 (for example).
All other routes should be catched with otherwise
like this:
$stateProvider.state('page2', { url: '/page2', controller: 'ShopsController', templateUrl: 'shops-tpl', reloadOnSearch: false });
$urlRouterProvider.otherwise(function() {
window.location = $location.absUrl();
})
the problem is what otherwise and router initialized only if user access page2, if user access root page otherwise doesn't work :(