I'm trying to add routes to my app, and I have a parent route with parentResolver and a child route with Child Resolver. When I access the '/parent', the parent resolver kicks in perfectly.
But the problem is, when I access '/parent/child', the parent resolver kicks in again before the child resolver can kick in. I don't want to run the parent resolver when I'm navigating to a child page.
So is there a way to skip the parent resolver when child route is called. Here's my route config
{
path: 'parent',
component: ParentComponent,
resolve: {parentData: ParentResolver},
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
children: [
{
path: 'child',
component: ChildComponent,
resolve: {childData: ChildResolver},
runGuardsAndResolvers: 'paramsOrQueryParamsChange'
}
]
}
ParentComponentis not a true parent, if it's behavior changes when a child is present. So maybe you can split it into what is needed generally (parent route without resolver) and what is needed only if no child is present (new route with parentresolver). - Jürgen Röhr