I am encountering some challenges with Angular routing, specifically when using nested routes:
The current 'abc' state works flawlessly for the route /admin/team/:teamId
.state('admin', {
url: '/admin',
controller: 'AdminController',
templateUrl: '/views/admin/index.html'
})
.state('admin.home', {
url: '/home',
parent: 'admin',
templateUrl: '/views/admin/dashboard.html'
})
.state('admin.team', {
url: '/team',
parent: 'admin',
controller: 'TeamController',
templateUrl: '/views/admin/team/index.html'
})
.state('abc', {
url: '/admin/team/:teamId',
// parent: 'admin.team',
controller: function($scope, $stateParams){
console.info('$stateParams.teamId', $stateParams.teamId);
},
templateUrl: '/views/admin/player/index.html'
});
However, when I replace the 'abc' state with the following state, the player template does not get rendered and instead retains the admin/team/index.html without any console output:
.state('admin.team.details', {
url: '/:teamId',
parent: 'admin.team',
controller: function($scope, $stateParams){
console.info('$stateParams.teamId', $stateParams.teamId);
},
templateUrl: '/views/admin/player/index.html'
});
Are there any solutions available to address this issue?