Hi I'm trying to create a nested route inside an already nested route. In synthesis, I have a portal which contains my sidebar and some other fancy stuff and there I can navigate to clusters. From clusters I should be able to select one cluster and view its details.
My "grandparent" route is called "portal" and the parent "clusters". Here's the code for clusters-route
(function () {
'use strict';
angular.module('ap.clusters.RouteConfig', ['blocks.router','ncy-angular-breadcrumb', 'ap.clusters.ClusterDetailsCtrl'])
.run(onRun);
/* @ngInject */
function onRun(routerHelper) {
routerHelper.configureStates(getStates());
}
function getStates() {
return [
{
state: 'portal.clusters',
config: {
url: '/clusters',
templateUrl: '/views/clusters/clusters.html',
controller: 'clustersCtrl',
controllerAs: 'vm',
title: 'Clusters',
ncyBreadcrumb: {
label: 'Clusters'
},
settings: {
nav: 4,
content: '<i class="fa fa-cubes nav-icon"></i>a<span>Clusters</span>'
}
}
}
];
}
})();
Here's the nested route I'm trying to include:
(function () {
'use strict';
angular.module('ap.clusters.clusterDetailsRouteConfig', ['blocks.router', 'ncy-angular-breadcrumb', 'ap.clusters.ClusterDetailsCtrl'])
.run(onRun);
/* @ngInject */
function onRun(routerHelper) {
routerHelper.configureStates(getStates());
}
function getStates() {
return [
{
state: 'portal.clusters.cluster-details',
config: {
url: '/cluster/:id',
templateUrl: '/views/clusters-details/clusters-details.html',
controller: 'clusterDetailsCtrl',
controllerAs: 'vm',
title: 'Cluster',
ncyBreadcrumb: {
label: '{{vm.cluster.name}}'
}
}
}
];
}
})();
The routing seems to be working fine, since the url is showing ....portal/clusters/cluster/0 or whatever index I select, but the html is not rendering. When I click the link just the url changes. Here's how i call the routing from clusters view (using jade)
a(ui-sref="portal.clusters.cluster-details({id: $index})")
Don't really know whats wrong with it, why isn't the html showing