I'am trying to find a good structure for an Angular 2 application which has something like interdependent components.
Here's the basic idea of the problem: There should be side navigation menu component and a content area which should contain the router-outlet. For some routes the side component should contain an additional component for navigation (e.g. a list of items for quick access where in the main content area is the "detail view").
Top level template structure:
<sidenav>
<featureA-nav-fragment></featureA-nav-fragment>
</sidenav>
<router-outlet>
<!-- featureA component -->
</router-outlet>
The menu should be a component which is indepentend from any other component or feature area and should not know about the additional navigation component but it should wrap this component.
One way to implement would be to define just the as top level component and in every screen which is defined by a route provide the side menu in the HTML-template. It seems to me that this is bad design cause parts of the HTML-code are duplicated.
An other alternative would be to create a switch on the active route in the menu component and include the correct navigation fragment there but this spreads the logic of the route (screen) into several components which seems to be an even worse design to me.
Using a named router-outlet for the navigation fragment isn't the right way to go neither since the components are not independently displayed from each other but always together. Modifying the route manually (clearing the nav fragment part) would break the design.
I didn't managed to find a good design for such a use case in the angular documentation yet. Am I missing something here?