I have a problem with angularjs url redirect. Using $location.path() to load the url seems working perfectly with url pattern likes $location.path('/admin'). But when i tried to load $location.path('/admin/home') it didn't work. If i tried with $location.path('home'), the html template is loaded. Below is my code.
$stateProvider
.state('admin', {
url: '/admin',
templateUrl: 'Admin/admin.html',
controller: 'adminController',
controllerAs: 'vm'
})
.state('admin.home', {
url: '/admin/home',
templateUrl: 'Admin/admin.home.html'
controller: 'adminHomeController',
controllerAs: 'vm'
})
Controller script
authorizeUser(function(result){
if(result === true) {
$location.path('/admin/home');
}
}