Hi I want to load a default child route as soon as i load the page Please check the code :
$stateProvider.state('userlist', {
url: '/users',
component: 'users',
data:{"name":"abhi"},
resolve: {
users: function(UserService) {
return UserService.list();
}
}
});
$stateProvider.state('userlist.detail', {
url: '/:userId',
component: 'userDetail',
resolve: {
user: function($transition$, users) {
return users.find(user => user.id == $transition$.params().userId);
}
}
});
$stateProvider.state('userlist.id', {
url: '/:username',
component: 'userName',
resolve: {
user: function($transition$, users) {
return users.find(user => user.name == $transition$.params().username);
}
}
});
});
by default route is navigating to /users . I want it to navigate to /user/userId by default .
By using
otherwise
you can set default routemore information