I'm using angular 4 in my project where I'm having 3 different sidebars (i.e with different content). I've enclosed an image below. In that, I want the component separation to be like. HomeScreen with no Sidebar. And Screen 1 with sidebar 1, Screen 2 With sidebar 2, Similarly sidebar 3 on the third screen. Which will be the efficient method to separate those sidebar components
Asked
Active
Viewed 674 times
0
-
it seems like you have sidebar but with different content not separate sidebar for mentioned screen.. – Vijay Sankhat Jun 02 '18 at 10:22
-
I'm really asking for suggestions because, I don't really like to create more components for side bar alone like sidebar1, 2 and 3. Since most of the UI Is same I want to use that as common layout and changing the contents based on the cliked links from the sidebar – VinoPravin Jun 02 '18 at 10:24
-
Then you can hide this sidebar when route is 'home' page – Vijay Sankhat Jun 02 '18 at 10:26
-
By using a seperate service for sidebar? – VinoPravin Jun 02 '18 at 10:27
-
Create separate component and template for sidebar and load it to your pages where you actually require – Vijay Sankhat Jun 02 '18 at 10:29
2 Answers
0
Create parent component for those pages which have sidebar or you can hide this sidebar based on the route. like you can hide sidebar when route is home.

Vijay Sankhat
- 341
- 3
- 17
-
-
May it helps you https://stackoverflow.com/questions/34597835/how-to-get-current-route – Vijay Sankhat Jun 02 '18 at 10:27