Reputation: 1
Here i don't want this (sidebar:cart-page
) please help me?
I wanted to make inner cart component common while searching based on tag and also don't want (sidebar:cart-page
)
Upvotes: 0
Views: 65
Reputation: 3137
This is not possible. Angular need to know which router-outlet
should be used. One way you can go is to use child-routes
. Then you only have own router-outlet
in the main component, and each child component has a router-outlet
, too.
const routes: Routes = [
{
path: 'first-component',
component: FirstComponent, // this is the component with the <router-outlet> in the template
children: [
{
path: 'child-a', // child route path
component: ChildAComponent, // child route component that the router renders
},
{
path: 'child-b',
component: ChildBComponent, // another child route component that the router renders
},
],
},
];
And children can have children, two. So your route looks different and without the (sidebar:cart-page)
.
Upvotes: 0