M
M
Michael2018-03-03 16:35:57
Angular
Michael, 2018-03-03 16:35:57

How to set a style for a component that will depend on the active route?

Hello. The second month I delve into Angular. I ran into a problem the other day. Essence: there is an application, the main structure is as follows:
- header with several routes (links)
- router-outlet
- footer
Main route - /home. There are also 4 more sections.
It is necessary that the header when opening /home be transparent, on all other sections it is white.
I can't figure out how to implement this. I tried directives, tried to do something through routerState (such a hobby), decorators, in general, nothing. Prompt those who know how to implement it, at least approximately. Again, I am a beginner and may have chosen the right method, but I screwed up.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question